home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 22 / Cream of the Crop 22.iso / database / eb108.zip / PACK1.PRG / EBOUT / EB3.REP < prev    next >
Text File  |  1996-11-10  |  202KB  |  8,865 lines

  1.  
  2.  
  3.       ════════════════════════════════════════════════════════════════
  4.                   EASY BASE PROGRAMMERS REFERENCE
  5.                             Contents
  6.       ────────────────────────────────────────────────────────────────
  7.  
  8.                   Procedure Commands            Page
  9.                   ──────────────────
  10.  
  11.                   Clear Records From             11
  12.                   Copy All From                  14
  13.                   Create Temp As                 15
  14.                   Declare                        27
  15.                   Delay                          30
  16.                   Delete Record                  32
  17.                   Derive Off                     33
  18.                   Display Status                 36
  19.                   Do..Loop                       37
  20.                   Escape On/Off                  39
  21.                   Exit Batch Menu                40
  22.                   Exit Procedure                 41
  23.                   For..Next                      48
  24.                   If Then Else                   61
  25.                   Index Off                      63
  26.                   List Variables                 73
  27.                   Lock / Unlock                  74
  28.                   Manual Feed                    79
  29.                   Multiple Lines                 86
  30.                   Next Batch                     87
  31.                   Odd/Even Page Print            88
  32.                   Pack                           97
  33.                   Pause On/Off                  100
  34.                   Preselect                     102
  35.                   Print                         103
  36.                   Printer Control               104
  37.                   Recall Input Screen           110
  38.                   Remark                        112
  39.                   Reset Sequence                113
  40.                   Run                           121
  41.                   Show Picklist                 128
  42.                   Skip Group                    130
  43.                   Skip Record                   131
  44.                   Subindex                      137
  45.                   Update Record                 147
  46. ................................................................................
  47.  
  48.  
  49.                   Functions                     Page
  50.                   ─────────
  51.  
  52.                   Abs                             1
  53.                   Chr$                           10
  54.                   Datetext                       23
  55.                   Dayofmonth                     24
  56.                   Dayofweek                      25
  57.                   Dayofyear                      26
  58.                   Default                        28
  59.                   Hours                          59
  60.                   If                             60
  61.                   Intext                         68
  62.                   Jointext                       69
  63.                   Lefttext                       70
  64.                   Lengthtext                     71
  65.                   Lookup                         75
  66.                   Lower                          76
  67.                   Makedate                       77
  68.                   Maketime                       78
  69.                   Maths                          80
  70.                   Midtext                        82
  71.                   Minutes                        83
  72.                   Mod                            84
  73.                   Month                          85
  74.                   Proper                        106
  75.                   Random                        107
  76.                   Retail                        115
  77.                   Reverse                       117
  78.                   Righttext                     118
  79.                   Round                         119
  80.                   Seconds                       123
  81.                   Spacepad                      132
  82.                   Spellday                      133
  83.                   Spellmonth                    134
  84.                   Stringof                      136
  85.                   Timeampm                      144
  86.                   Upper                         148
  87.                   V.A.T. Functions              149
  88.                   Year                          151
  89.                   Zeropad                       152
  90.  
  91.  
  92.                   Operators                     Page
  93.                   ─────────
  94.  
  95.                   Arithmetic                     92
  96.                   Logical                        94
  97.                   Relational                     93
  98. ................................................................................
  99.  
  100.  
  101.                   Utilities                     Page
  102.                   ─────────
  103.  
  104.                   Alter Vat Rates                 2
  105.                   Backup Application              4
  106.                   Change Password                 8
  107.                   Data Import                    20
  108.                   Delete Choice Lists            31
  109.                   Install Form                   64
  110.                   Install Printer                65
  111.                   Install Procedure              66
  112.                   List File Names                72
  113.                   Options                        95
  114.                   Pack Data Forms                98
  115.                   Rebuild Directories           109
  116.                   Restore                       114
  117.                   Screen Colours                122
  118.                   Set Paper Length              126
  119.  
  120.  
  121.                   Field Types                   Page
  122.                   ───────────
  123.  
  124.                   Choice                          9
  125.                   Date                           22
  126.                   Fixed Point                    46
  127.                   Floating Point                 47
  128.                   Formatted Text                 54
  129.                   Integer                        67
  130.                   Text                          141
  131.                   Text Block                    142
  132.                   Time                          143
  133.  
  134.  
  135.                   Field Derivation Prefixes     Page
  136.                   ─────────────────────────
  137.  
  138.                   Autodial                        3
  139.                   Current                        16
  140.                   Disable                        34
  141.                   Goto (Field) Next              57
  142.                   Help                           58
  143.                   Retest                        116
  144.                   Start Here                    135
  145.  
  146.  
  147.                   User Menu Functions           Page
  148.                   ───────────────────
  149.  
  150.                   Menu Calls                     81
  151. ................................................................................
  152.  
  153.  
  154.                   System Values                 Page
  155.                   ─────────────
  156.  
  157.                   Blank.                          6
  158.                   Bottom Margin                   7
  159.                   Current Record                 17
  160.                   Cur_fld                        19
  161.                   File_date File_time            42
  162.                   File_len                       43
  163.                   File_pos                       44
  164.                   Fun_key                        55
  165.                   Global Number                  56
  166.                   Output                         96
  167.                   Page Number                    99
  168.                   Pi                            101
  169.                   Prog_dir                      105
  170.                   Record Number                 111
  171.                   Sequence                      125
  172.                   System Date                   139
  173.                   System Time                   140
  174.                   Total Copies                  145
  175.                   Total Records                 146
  176.  
  177.  
  178.                   File Commands
  179.                   ─────────────
  180.  
  181.                   Close                          13
  182.                   Erase                          38
  183.                   Find                           45
  184.                   Open                           91
  185.                   Read                          108
  186.                   Seek                          124
  187.                   Shell                         127
  188.                   Write                         150
  189.  
  190.  
  191.                   Field Controls                Page
  192.                   ──────────────
  193.  
  194.                   Beep                            5
  195.                   Clearfields                    12
  196.                   Cursor                         18
  197.                   Delay                          29
  198.                   Disable                        35
  199.                   Run                           120
  200. ................................................................................
  201.       ABS                        FUNCTION                         ABS
  202.  
  203.       This function returns the absolute (positive) value of a
  204.       number.
  205.  
  206.       Ex. abs(length - breadth)
  207.          This returns 6 if length = 12 and breadth = 6
  208.          or if length = 6 and breadth = 12
  209.  
  210.  
  211.       Acceptable parameters
  212.  
  213.       Numeric value
  214.       Numeric expression
  215.       Numeric field/variable
  216.       Any function which returns a numeric value
  217.  
  218.  
  219.  
  220.  
  221.  
  222.  
  223.  
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.                                 - 1 -
  257. ................................................................................
  258.       ALTER VAT RATES            UTILITY              ALTER VAT RATES
  259.  
  260.       The five VAT rates used by the VAT functions can be altered
  261.       either from the utilities menu or from a user menu function.
  262.       Just select "Alter VAT rates" - edit the percentages and press
  263.       F2 to save the new values.
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.  
  271.  
  272.  
  273.  
  274.  
  275.  
  276.  
  277.  
  278.  
  279.  
  280.  
  281.  
  282.  
  283.  
  284.  
  285.  
  286.  
  287.  
  288.  
  289.  
  290.  
  291.  
  292.  
  293.  
  294.  
  295.  
  296.  
  297.  
  298.  
  299.  
  300.  
  301.  
  302.  
  303.  
  304.  
  305.  
  306.  
  307.  
  308.  
  309.  
  310.  
  311.  
  312.  
  313.                                 - 2 -
  314. ................................................................................
  315.       AUTODIAL               DERIVATION PREFIX               AUTODIAL
  316.  
  317.       Easy Base will dial (via a Hayes compatible modem) direct from
  318.       any form or procedure input screen.
  319.  
  320.       To use the Auto dialling facility, all you have to do is place
  321.       the "autodial" keyword in the derivation of the field which
  322.       contains the telephone number. If the field already has a
  323.       derivation then add "autodial" as a prefix.
  324.  
  325.       Ex. Autodial Lookup(customers,phone)
  326.  
  327.       To initiate the call type Ctrl + D.
  328.  
  329.       By default Easy Base uses tone dialling via COM1. If your modem
  330.       is connected to COM2 you can set this up from the Options item
  331.       on the Utilities menu.
  332.  
  333.       If your exchange does not recognize tone dialling then you can
  334.       pulse dial by pressing Ctrl + P.
  335.  
  336.       If you operate from a private exchange and have to wait for an
  337.       outside line after dialling 9 then place a "W" between the 9
  338.       and the rest of the number.
  339.  
  340.  
  341.       Note:-
  342.  
  343.       1.   You can have more than one prefix on any one field
  344.            derivation provided there is a space between each.
  345.  
  346.       2.   The Autodial prefix cannot be tested in derivation test
  347.            mode.
  348.  
  349.  
  350.  
  351.  
  352.  
  353.  
  354.  
  355.  
  356.  
  357.  
  358.  
  359.  
  360.  
  361.  
  362.  
  363.  
  364.  
  365.  
  366.  
  367.  
  368.  
  369.  
  370.                                 - 3 -
  371. ................................................................................
  372.       BACKUP APPLICATION         UTILITY           BACKUP APPLICATION
  373.  
  374.       Easy Base includes an inbuilt Backup system for your
  375.       applications and data.
  376.  
  377.       If you select "Backup Application" from the utilities menu then
  378.       Easy Base will backup your entire application - Choicelist
  379.       fields - Forms - Data and procedures. The backup system will
  380.       split large files across multiple disks automatically.
  381.  
  382.       When an application is finished and you have backup copies then
  383.       backing up choice lists and procedures is wasteful of time and
  384.       floppies. You can backup only the users data by calling "Backup
  385.       Data" from a user menu.
  386.  
  387.       Backup Principles.
  388.  
  389.       The reason for a backup is that in the event of a computer or
  390.       hard disk failure you will have your application or data to
  391.       restore on the new machine.
  392.  
  393.  
  394.       If you have no backup and your machine fails then you have lost
  395.       all your data. If you have only one backup and your machine
  396.       fails while doing a backup then you have lost all your data.
  397.  
  398.       The principle of safe backing up is to keep two sets of backup
  399.       disks in separate boxes marked "Latest" and "Previous".
  400.       Whenever you do a backup you use the disks from the "Previous"
  401.       box - move the disks from the "Latest" to the "Previous" and
  402.       put your new backups in the latest box when completed.
  403.  
  404.       This not only overcomes the problem of a failure during backup
  405.       but also provides a secondary set of disks if any of the
  406.       "Latest" disks turn out to be faulty when you come to restore.
  407.  
  408.       If you ever have to use a backup disk and find that it has
  409.       developed a bad sector then you can attempt a recovery with a
  410.       utility such as "Norton" Disk Test. Easy Base leaves
  411.       approximately 5K of unused disk space on all backup disks so
  412.       that such a utility has somewhere to move bad sectors to.
  413.  
  414.       To save disk space, Easy Base does not backup index files. If
  415.       you ever have to use a backup disk then the index files are
  416.       rebuilt after restoring the data.
  417.  
  418.  
  419.       See Also:-  Restore
  420.  
  421.  
  422.  
  423.  
  424.  
  425.  
  426.  
  427.                                 - 4 -
  428. ................................................................................
  429.       BEEP                     FIELD CONTROL                     BEEP
  430.  
  431.       The "beep" control is used in field derivations to alert the
  432.       user to input errors. In addition to sounding the beeper the
  433.       "beep" control has two optional additional parts - A message to
  434.       be sent to the message line and cursor redirection. This is
  435.       normally to the field in which the error has been made but can
  436.       be to any field.  Field controls are appended to field
  437.       derivations and are enclosed in square brackets.
  438.  
  439.       Ex.  If(partno < 0,blank[beepPart Numbers must not be
  440.       negativeCursor partno],partno)
  441.  
  442.       In this example, if the user enters a negative number in the
  443.       partno field the computer will beep,the number will be cleared
  444.       from the field, the message "Part Numbers must not be negative"
  445.       will be displayed on the message line and the cursor will
  446.       return to the "partno" field.
  447.  
  448.       Ex. If(paid = "no" and chequeno <> blank,paid[beepEither bill
  449.       has been paid or cheque number entered in errorCursor
  450.       paid],paid)
  451.  
  452.       In Easy Base, division by zero is not trapped as an error.
  453.       There is a very good reason for this.  When you start a new
  454.       record and all the fields are blank then any field which
  455.       provides a value for a division in another field would cause a
  456.       division by zero error before its value had been entered.
  457.  
  458.       Whenever Easy Base encounters a division by Zero it divides by
  459.       one instead.  This is perfectly acceptable in most business
  460.       applications.  However, if you need to be warned of a division
  461.       by zero in formulae then you can provide your own error trap
  462.       using the "Beep" control.
  463.  
  464.       Ex.
  465.  
  466.          If( T4 = 0,blank[beepDivision by Zero Value from Field T4],
  467.                       T4)
  468.  
  469.  
  470.       NETWORK VERSIONS
  471.  
  472.       From the release of Network V1 there is also a Beep command in
  473.       the procedure language.
  474.  
  475.       See Example under "Recall Input Screen"
  476.  
  477.  
  478.  
  479.  
  480.  
  481.  
  482.  
  483.  
  484.                                 - 5 -
  485. ................................................................................
  486.       BLANK.                   SYSTEM VALUE                    BLANK.
  487.  
  488.       In Easy Base the value of any field which does not contain
  489.       characters is represented by the word "Blank" irrelevant of
  490.       data type.
  491.  
  492.       A numeric field returns the value "Blank" only when the field
  493.       is empty. If it has a value of zero then it is NOT blank.  In
  494.       fact, the main advantage of recognizing "Blank" is that you can
  495.       distinguish between zero value and empty numeric fields.
  496.  
  497.       There is, however, one slight disadvantage.  If a text field
  498.       contains ONLY the word blank and you use its value in a
  499.       derivation then the word "Blank" from the field will disappear.
  500.  
  501.       The "Name" field at the top left hand side of this page is
  502.       derived by the formula Upper(Name).  You will notice that
  503.       "Blank" is followed by a full stop.  If it were not then the
  504.       upper function would return "                    ".
  505.  
  506.       You can also remove a fields contents by setting it equal to
  507.       blank.
  508.  
  509.  
  510.  
  511.  
  512.  
  513.  
  514.  
  515.  
  516.  
  517.  
  518.  
  519.  
  520.  
  521.  
  522.  
  523.  
  524.  
  525.  
  526.  
  527.  
  528.  
  529.  
  530.  
  531.  
  532.  
  533.  
  534.  
  535.  
  536.  
  537.  
  538.  
  539.  
  540.  
  541.                                 - 6 -
  542. ................................................................................
  543.       BOTTOM MARGIN            SYSTEM VALUE             BOTTOM MARGIN
  544.  
  545.       Throughout a procedure which has a printed output, Easy base
  546.       keeps track of the length of page remaining (in inches) in the
  547.       system value "Bottom Margin". The Bottom margin value is used
  548.       to control pagination in procedures which "Report" on data.
  549.  
  550.       The "Bottom Margin" value is based on the paper type entered
  551.       from the Utilities Menu. You must set the type of paper you are
  552.       using before using "Bottom Margin".
  553.  
  554.       Ex.
  555.       Line feed: Line feed: Line feed
  556.       For employees
  557.          print list items
  558.          if bottom margin < .5 then
  559.             page feed: line feed :line feed : line feed
  560.          else
  561.             line feed
  562.          end if
  563.       next
  564.  
  565.       In the above example the list items section is printed with a
  566.       blank line between each and with a half inch top and bottom
  567.       page margin.
  568.  
  569.       When you base decisions on the "Bottom margin" value you should
  570.       always do so with a "Greater Than" or "Less Than" operator. If
  571.       you used " If Bottom margin = .5 then Page feed" your page
  572.       would only be ejected if and when the "Bottom Margin" value was
  573.       exactly 0.5  As most printing is done at six lines to the inch
  574.       it is most unlikely that the "Bottom margin" value would ever
  575.       be half an inch.
  576.  
  577.  
  578.  
  579.  
  580.  
  581.  
  582.  
  583.  
  584.  
  585.  
  586.  
  587.  
  588.  
  589.  
  590.  
  591.  
  592.  
  593.  
  594.  
  595.  
  596.  
  597.  
  598.                                 - 7 -
  599. ................................................................................
  600.       CHANGE PASSWORD            UTILITY              CHANGE PASSWORD
  601.  
  602.       You can change your developers access password with this item
  603.       on the utilities menu.
  604.  
  605.  
  606.  
  607.  
  608.  
  609.  
  610.  
  611.  
  612.  
  613.  
  614.  
  615.  
  616.  
  617.  
  618.  
  619.  
  620.  
  621.  
  622.  
  623.  
  624.  
  625.  
  626.  
  627.  
  628.  
  629.  
  630.  
  631.  
  632.  
  633.  
  634.  
  635.  
  636.  
  637.  
  638.  
  639.  
  640.  
  641.  
  642.  
  643.  
  644.  
  645.  
  646.  
  647.  
  648.  
  649.  
  650.  
  651.  
  652.  
  653.  
  654.  
  655.                                 - 8 -
  656. ................................................................................
  657.       CHOICE                    FIELD TYPE                     CHOICE
  658.  
  659.       If you define a field as the "Choice" type a window will open
  660.       into which you can type up to thirty four different choices.
  661.       When you have entered your choices you will be asked to give a
  662.       name to your choice list. Once a choice list has been saved it
  663.       can be used in any other choice field in any other form or
  664.       input screen.
  665.  
  666.       Once a choice list has been saved you can edit the contents but
  667.       not the field length. Editing a choice list in one form
  668.       automatically edits it for any other form.
  669.  
  670.       If you need to alter a list such that the field length will
  671.       change then you must create a new list. You can erase the old
  672.       one from the utilities menu.  If the list is used in more than
  673.       one form then you must redefine it in all the other forms in
  674.       which it is used
  675.  
  676.       When the cursor enters a choice field your choice list will be
  677.       displayed for the user to choose from. He cannot enter any
  678.       value other than one from the list.
  679.  
  680.       When the cursor enters a choice field that is blank, the list
  681.       will pop up for the user to choose from. If there are more than
  682.       nine choices on the list then only the first nine will display
  683.       automatically. For up to nine choices the user can pick one by
  684.       pressing the number of the choice or leave the field blank by
  685.       simply moving the cursor. If there are more than nine choices
  686.       then the entire list can be displayed by pressing the space
  687.       bar. When a list of more than nine is displayed the user must
  688.       select a choice or press the Escape key.
  689.  
  690.       When the cursor re enters a choice field in which a choice has
  691.       already been made the same events occur except that in the case
  692.       of a two choice list the two choices are toggled on the space
  693.       bar without actually being displayed.
  694.  
  695.  
  696.  
  697.  
  698.  
  699.  
  700.  
  701.  
  702.  
  703.  
  704.  
  705.  
  706.  
  707.  
  708.  
  709.  
  710.  
  711.  
  712.                                 - 9 -
  713. ................................................................................
  714.       CHR$                       FUNCTION                        CHR$
  715.  
  716.       The Chr$ function returns the character whose ASCII number is
  717.       supplied as the parameter.
  718.  
  719.       Ex.   Chr$(171)
  720.             < Returns "½">
  721.  
  722.       Ex.   Jointext(Chr$(227),"r",Chr$(253))
  723.             < Returns "πr²"
  724.  
  725.       In Easy Base, text fields are automatically justified left.
  726.       This is desirable in record entry as it prevents the user from
  727.       entering leading spaces in indexed fields and consequently
  728.       trashing alphabetic printouts. However, you may wish to right
  729.       justify or centre justify text in printouts. For example, the
  730.       righthand "Chr$" at the top of this page is right justified in
  731.       its field. You can use the ASCII character 255 to achieve right
  732.       or centre justification.
  733.  
  734.       Ex.
  735.  
  736.       Heading = jointext(stringof((30-lengthtext(name))/2,Chr$(255)),
  737.       name)
  738.           < This centres name in the 30 character field "heading">
  739.  
  740.       Ex.
  741.  
  742.       Heading =Jointext(stringof(40-lengthtext(name),Chr$(255)),name)
  743.  
  744.          < This right justifies name in a 40 character field
  745.            "Heading">
  746.  
  747.  
  748.       CAUTION:
  749.  
  750.       You can produce any ASCII character ( 0 - 255 ) with the Chr$
  751.       function. ASCII characters 0 to 31 are used as printer controls
  752.       and although you can use them freely on screen you should never
  753.       include them in a procedure output which will be sent to the
  754.       printer.
  755.  
  756.       The ASCII character 127 is used internally by Easy Base to
  757.       replace quotation marks within quoted text. It should not be
  758.       used for any other purpose.
  759.  
  760.       Acceptable parameters:
  761.  
  762.       Numeric value, field, variable, expression or function
  763.       returning a number between 0 and 255
  764.  
  765.  
  766.  
  767.  
  768.  
  769.                                 - 10 -
  770. ................................................................................
  771.       CLEAR RECORDS FROM     PROCEDURE COMMAND     CLEAR RECORDS FROM
  772.  
  773.       The "Clear Records From" command clears all records from a form
  774.       by erasing its data and index files. If you need to erase all
  775.       records form a form always use the "Clear Records" command
  776.       rather than "Delete Record" command. It is much faster and does
  777.       not require the form to be re-packed afterward.
  778.  
  779.       Ex.
  780.  
  781.       If input.confirm = "yes" then clear records from invoices
  782.  
  783.  
  784.  
  785.  
  786.  
  787.  
  788.  
  789.  
  790.  
  791.  
  792.  
  793.  
  794.  
  795.  
  796.  
  797.  
  798.  
  799.  
  800.  
  801.  
  802.  
  803.  
  804.  
  805.  
  806.  
  807.  
  808.  
  809.  
  810.  
  811.  
  812.  
  813.  
  814.  
  815.  
  816.  
  817.  
  818.  
  819.  
  820.  
  821.  
  822.  
  823.  
  824.  
  825.  
  826.                                 - 11 -
  827. ................................................................................
  828.       CLEARFIELDS              FIELD CONTROL              CLEARFIELDS
  829.  
  830.       The "Clearfields" control blanks out all other fields on a form
  831.       or procedure input screen whenever the field containing the
  832.       control is changed.
  833.  
  834.       The primary use for the "Clearfields" control is to force
  835.       default lookups to re-derive for procedures which edit data.
  836.  
  837.       For Example - If you wrote a procedure to alter customers
  838.       addresses and telephone numbers then you would have three
  839.       fields on the input screen.
  840.  
  841.       Accountno   derived   lookup(customers,accountno)
  842.  
  843.       address     derived   default(lookup(customers,address))
  844.  
  845.       Tel         derived   default(lookup(customers,tel))
  846.  
  847.       When you enter a customers account number, his old address and
  848.       telephone number will be looked up, but the "Default" function
  849.       will allow you to edit them. The procedure code would then
  850.       update the record with the new address and phone number.
  851.  
  852.       The problem is, that having entered an account number and
  853.       looked up the other fields, if you then realize you have
  854.       entered the wrong account number and change it, the other
  855.       fields will not re-derive because they now have a default
  856.       value.  To get them to lookup based on the new account number
  857.       you would have to take the cursor to each field and clear it
  858.       with the F6 key.
  859.  
  860.       you can automate this process by adding the "Clearfields"
  861.       control to the accountno derivation:-
  862.  
  863.       lookup(customers,accountno)[clearfields]
  864.  
  865.  
  866.       Note:  The "Clearfields" control will only work when appended
  867.       to a derivation which is already dependent on the value of the
  868.       field. If you want to clear fields based on a change to a field
  869.       which has no other derivation then you must derive the field
  870.       with its own name plus the "Clearfields" control.
  871.  
  872.       In a field "Number" the derivation - Number[clearfields] - will
  873.       clear all other fields when the "Number" field is edited but
  874.       the derivation [clearfields] will have no effect.
  875.  
  876.  
  877.  
  878.  
  879.  
  880.  
  881.  
  882.  
  883.                                 - 12 -
  884. ................................................................................
  885.       Close                    File Command                     Close
  886.  
  887.       The "Close" command closes a non Easy Base file which has been
  888.       opened with the "Open" command.
  889.  
  890.       If a procedure only opens a single external file then the close
  891.       command can be ommitted, but if several files are opened within
  892.       a procedure then each must be closed before the next is opened.
  893.       You can only have one external file open at any one time.
  894.  
  895.       ....................
  896.       declare output fields
  897.          Files : Path
  898.       end
  899.       declare variables
  900.         Ln as text
  901.       end
  902.       Open  "C:\CONFIG.SYS"
  903.       do
  904.          Read line to Ln
  905.          if lefttext(Ln,6) = "files=" then exit do
  906.       Loop
  907.       Files = Ln
  908.       Close
  909.       Open "C:\AUTOEXEC.BAT"
  910.       Do
  911.          read line to Ln
  912.          if Lefttext(Ln,4) = "path" then exit do
  913.       Loop
  914.       Close
  915.       Path = Ln
  916.       Print List Items
  917.  
  918.  
  919.       See also: Open, Seek, Read, Write, Find, Erase
  920.  
  921.  
  922.  
  923.  
  924.  
  925.  
  926.  
  927.  
  928.  
  929.  
  930.  
  931.  
  932.  
  933.  
  934.  
  935.  
  936.  
  937.  
  938.  
  939.  
  940.                                 - 13 -
  941. ................................................................................
  942.       COPY ALL FROM          PROCEDURE COMMAND          COPY ALL FROM
  943.  
  944.       When you are transferring values from the fields of one form to
  945.       the fields of another in preparation for a "New Record" or
  946.       "Update Record"  you can use "Copy All From" to save time.
  947.  
  948.       Ex.
  949.  
  950.       for invoiceitems new record
  951.          invoiceitems.item = input.item
  952.          invoiceitems.price = input.price
  953.          invoiceitems.quantity = input.quantity
  954.          invoiceitems.vatrate = input.vatrate
  955.       next
  956.  
  957.       can be replaced with:-
  958.  
  959.       for invoiceitems new record
  960.          copy all from input
  961.       next
  962.  
  963.       The data transfer in a "Copy All From" is based on the source
  964.       and destination fields having the same name.
  965.  
  966.       If the source and destination fields have different data types
  967.       Easy Base will attempt a conversion.
  968.  
  969.       The conversion will succeed between different numeric types and
  970.       from numeric to text. It will fail from text to numeric and
  971.       between any mismatch of date and time.
  972.  
  973.  
  974.  
  975.  
  976.       See also:-  Derive Off, Duplicate Prevention
  977.  
  978.  
  979.  
  980.  
  981.  
  982.  
  983.  
  984.  
  985.  
  986.  
  987.  
  988.  
  989.  
  990.  
  991.  
  992.  
  993.  
  994.  
  995.  
  996.  
  997.                                 - 14 -
  998. ................................................................................
  999.       CREATE TEMP AS         PROCEDURE COMMAND         CREATE TEMP AS
  1000.  
  1001.       The "Create Temp As" command makes a temporary form during a
  1002.       procedure. There are two main uses for the temporary form.
  1003.  
  1004.       1.  To physically sort the records in a form.
  1005.  
  1006.       Ex.
  1007.  
  1008.       create temp as addresses
  1009.       index off:pause off:escape off:derive off
  1010.       for addresses with surname in order
  1011.          for temp new record
  1012.             copy all from addresses
  1013.          next
  1014.       next
  1015.       rename temp as addresses
  1016.  
  1017.       The other main use for the temporary file is to save time when
  1018.       the majority of records in a form are to be deleted.
  1019.  
  1020.       Ex.
  1021.       A purchases ledger form is to be cleared down at the year end
  1022.       but any unreconciled payment entries are to be retained and
  1023.       flagged as last years. If there were 15000 records in the form
  1024.       of which only 50 were unreconciled then the procedure
  1025.  
  1026.       for purchases
  1027.          if purchases.reconciled = "yes" then
  1028.             delete record
  1029.          else
  1030.             purchases.lastyear = "yes"
  1031.             update record
  1032.          end if
  1033.       next
  1034.  
  1035.       would not only take a very long time to run but would leave the
  1036.       form full of deleted records and it would have to be re-packed.
  1037.  
  1038.       The same result can be achieved very quickly and without the
  1039.       need to re-pack with the following procedure.
  1040.  
  1041.       create temp as purchases
  1042.       for purchases with reconciled = "no"
  1043.          for temp new record
  1044.             copy all from purchases
  1045.             temp.lastyear = "yes"
  1046.          next
  1047.       next
  1048.       rename temp as purchases
  1049.  
  1050.       Do not use the "Clear Records" command to wipe the old file
  1051.       before using "Rename Temp As".  If you suffered a power failure
  1052.       after clearing and before renaming you would lose your data.
  1053.  
  1054.                                 - 15 -
  1055. ................................................................................
  1056.       CURRENT                DERIVATION PREFIX                CURRENT
  1057.  
  1058.       In Easy Base, fields are not normally derived when a previously
  1059.       entered record is viewed on screen. You can force a field to be
  1060.       rederived when viewed by prefixing the derivation with
  1061.       "current".
  1062.  
  1063.       Ex.  An invoice form has three fields Ivdate,Cdate and age.
  1064.  
  1065.       Ivdate is derived as   "system date"
  1066.       Cdate is derived as    "current system date"
  1067.       age is derived as      jointext(Cdate-Ivdate," Days old")
  1068.  
  1069.       Each time a record is viewed the Cdate field is rederived with
  1070.       the current system date and the age field shows the number of
  1071.       days since the record was filed.
  1072.  
  1073.       Ex.
  1074.  
  1075.       A form is used to price a certain job. It consists of fields
  1076.       for materials and their prices which are looked up from a
  1077.       "stock" form. If the primary lookup fields are prefixed with
  1078.       "current"   -  "current lookup(stock,item)"
  1079.  
  1080.       then each time a record is viewed it will reprice the job using
  1081.       the latest prices from the "stock" file.
  1082.  
  1083.       Please note that in the case of lookups, prefixing a secondary
  1084.       lookup has no effect. In the above example
  1085.  
  1086.         "current lookup(stock,price)"  would not work
  1087.  
  1088.       Provided that the primary lookup field is prefixed with
  1089.       "current" then any secondary lookups will also be rederived.
  1090.  
  1091.  
  1092.       The values of "Current" fields are also rederived whenever they
  1093.       are accessed in procedure code but they are NOT REDERIVED when
  1094.       they are accessed by a Lookup function.
  1095.  
  1096.  
  1097.       1. You can have more than one prefix on any one field
  1098.          derivation provided there is a space between each.
  1099.  
  1100.  
  1101.  
  1102.  
  1103.  
  1104.  
  1105.  
  1106.  
  1107.  
  1108.  
  1109.  
  1110.  
  1111.                                 - 16 -
  1112. ................................................................................
  1113.       Current Record           SYSTEM VALUE            Current Record
  1114.  
  1115.       Whenever a procedure is processing a "For" loop the number of
  1116.       the record being processed is available in the system value
  1117.       "Current Record".
  1118.  
  1119.       NETWORK VERSIONS
  1120.  
  1121.       From the release of Network V1 the system value Current Record
  1122.       has been replaced by a pseudo field Form.Record Number
  1123.  
  1124.  
  1125.  
  1126.  
  1127.  
  1128.  
  1129.  
  1130.  
  1131.  
  1132.  
  1133.  
  1134.  
  1135.  
  1136.  
  1137.  
  1138.  
  1139.  
  1140.  
  1141.  
  1142.  
  1143.  
  1144.  
  1145.  
  1146.  
  1147.  
  1148.  
  1149.  
  1150.  
  1151.  
  1152.  
  1153.  
  1154.  
  1155.  
  1156.  
  1157.  
  1158.  
  1159.  
  1160.  
  1161.  
  1162.  
  1163.  
  1164.  
  1165.  
  1166.  
  1167.  
  1168.                                 - 17 -
  1169. ................................................................................
  1170.       Cursor                   FIELD CONTROL                   Cursor
  1171.  
  1172.       The field control "Cursor" sends the cursor to the named field.
  1173.  
  1174.       if(condition,fieldname[cursor fieldname2],fieldname)
  1175.  
  1176.       The cursor control can also be embedded in the beep control.
  1177.  
  1178.       See also "Beep"
  1179.  
  1180.  
  1181.  
  1182.  
  1183.  
  1184.  
  1185.  
  1186.  
  1187.  
  1188.  
  1189.  
  1190.  
  1191.  
  1192.  
  1193.  
  1194.  
  1195.  
  1196.  
  1197.  
  1198.  
  1199.  
  1200.  
  1201.  
  1202.  
  1203.  
  1204.  
  1205.  
  1206.  
  1207.  
  1208.  
  1209.  
  1210.  
  1211.  
  1212.  
  1213.  
  1214.  
  1215.  
  1216.  
  1217.  
  1218.  
  1219.  
  1220.  
  1221.  
  1222.  
  1223.  
  1224.  
  1225.                                 - 18 -
  1226. ................................................................................
  1227.       Cur_Fld                  SYSTEM VALUE                   Cur_Fld
  1228.  
  1229.       The System value Cur_Fld holds the number of the field which
  1230.       the cursor is in.
  1231.  
  1232.       The Cur_Fld value can be used in form and input screen
  1233.       derivations to create pop up prompt fields or to change
  1234.       additional help fields.
  1235.  
  1236.       if(Cur_Fld > 2,"Enter the price",blank)
  1237.  
  1238.       If(Cur_Fld < 7,"Help for first six fields",Help for later
  1239.       fields")
  1240.  
  1241.       The Cur_Fld value can also be used to delay lookups when a
  1242.       screen first loads.
  1243.  
  1244.       if(Cur_Fld < 5,blank,lookup(customers,name))
  1245.  
  1246.       In the case of input screens the value is also carried forward
  1247.       to the procedure code so you can tell which field the cursor
  1248.       was in when the procedure was run.
  1249.  
  1250.  
  1251.  
  1252.  
  1253.  
  1254.  
  1255.  
  1256.  
  1257.  
  1258.  
  1259.  
  1260.  
  1261.  
  1262.  
  1263.  
  1264.  
  1265.  
  1266.  
  1267.  
  1268.  
  1269.  
  1270.  
  1271.  
  1272.  
  1273.  
  1274.  
  1275.  
  1276.  
  1277.  
  1278.  
  1279.  
  1280.  
  1281.  
  1282.                                 - 19 -
  1283. ................................................................................
  1284.       Data Import                UTILITY                  Data Import
  1285.  
  1286.       There are four Data Import routines in Easy Base. The first
  1287.       imports data from files which conform to the Xbase standard
  1288.       first introduced by Dbase. The second imports data from "Comma
  1289.       Delimited" files. This is the standard used by most sequencial
  1290.       access and non relational data systems. The third routine
  1291.       imports data from fixed length record text files. This is the
  1292.       format which is used by all systems to output data. You can
  1293.       therefore import data from virtually any other system by first
  1294.       reporting on it to a disk file and then importing it with the
  1295.       fixed length ASCII import routine. The fourth routine imports
  1296.       one ASCII line per field.
  1297.  
  1298.       XBASE
  1299.  
  1300.       If the data you wish to import is in Xbase format, Easy Base
  1301.       will report the structure of the file. You can print this out
  1302.       by pressing F10. You now design a form to hold the imported
  1303.       data. The names that you give to the Easy Base fields do not
  1304.       have to be the same as the Xbase field names but they must be
  1305.       in the same order. If the Xbase fields are text then the Easy
  1306.       Base fields must be the same length. If the Xbase fields are
  1307.       numeric then the Easy Base fields must be numeric. It does not
  1308.       matter if they are different lengths and any of the three
  1309.       types, integer, fixed point or floating point can be used.
  1310.       If an Xbase field is a date field then it must be imported to
  1311.       an eight character text field in Easy Base. You can reformat it
  1312.       to an Easy Base date field after importation (See the Method -
  1313.       Data Type Conversion).  Easy Base does not support "Memo" data.
  1314.       If the Xbase file has a memo field you can still import from it
  1315.       but the memo field itself will be skipped by the import
  1316.       routine.
  1317.  
  1318.       COMMA DELIMITED
  1319.  
  1320.       To import data from comma delimited files all you have to do is
  1321.       design a form with the same number of fields as there are in
  1322.       the file to be imported. Numeric fields can be any of the three
  1323.       types and text fields should be long enough to hold the longest
  1324.       data expected in the incoming field. If any of the fields to be
  1325.       imported holds a date then it must be imported to a text field.
  1326.       You can convert it to a date later.
  1327.  
  1328.       FIXED LENGTH ASCII
  1329.  
  1330.       To import data from fixed length ASCII files you must design a
  1331.       form in which all fields are text and are exactly the same
  1332.       length and in the same order as the fields in the file to be
  1333.       imported. If the file to be imported has a header you can allow
  1334.       for this by entering the header length in bytes.
  1335.  
  1336.       If you are using the fixed length import routine to import data
  1337.       which you have output as a report from another system then
  1338.  
  1339.                                 - 20 -
  1340. ................................................................................
  1341.       Data Import                UTILITY                  Data Import
  1342.  
  1343.       please note the following points.
  1344.  
  1345.       The output report from the original system should have no
  1346.       headers, footers or left margin and there should be no spaces
  1347.       between fields.
  1348.  
  1349.       When the original system outputs the data it will add a
  1350.       carriage return and line feed sequence to the end of each
  1351.       record. When you design the form to import this data to, you
  1352.       must have a final two character text field to trap this
  1353.       sequence and maintain the same record length.  This field can
  1354.       be deleted after importation.
  1355.  
  1356.       All fields are imported as text. If any of them contain numeric
  1357.       values which you wish to convert to numeric fields you must do
  1358.       this after importation. (See Method Data Type Conversion)
  1359.  
  1360.       ASCII LINE
  1361.  
  1362.       The ASCII line import routine imports one line per field from
  1363.       an ASCII text file. If you have one field on the form to which
  1364.       you import then you will have one line per record. If you have
  1365.       two fields on the form to which you import then you will have
  1366.       two lines per record Etc.
  1367.  
  1368.       The import routines are for loading entire data files into Easy
  1369.       Base. For Flexible import and export to any part of any file
  1370.       see the External File Commands documentation.
  1371.  
  1372.  
  1373.  
  1374.  
  1375.  
  1376.  
  1377.  
  1378.  
  1379.  
  1380.  
  1381.  
  1382.  
  1383.  
  1384.  
  1385.  
  1386.  
  1387.  
  1388.  
  1389.  
  1390.  
  1391.  
  1392.  
  1393.  
  1394.  
  1395.  
  1396.                                 - 21 -
  1397. ................................................................................
  1398.       DATE                      FIELD TYPE                       DATE
  1399.  
  1400.       Date fields hold dates in the eight character format 11/11/94
  1401.  
  1402.       The assumed century runs from the first of January 1981 to the
  1403.       31st of december 2080.
  1404.  
  1405.       You can select whether you wish your dates to be displayed as
  1406.       day/month/year (European) or month/day/year (North American)
  1407.       from the "options" item on the utilities menu.
  1408.  
  1409.       You can perform addition and subtraction operations on date
  1410.       values in days.
  1411.  
  1412.       Ex.  System date + 30
  1413.  
  1414.       Arithmetic operations are only correct for the assumed century.
  1415.  
  1416.       Date fields are automatically checked for validity by the
  1417.       system.
  1418.  
  1419.       Easy base does not provide a ready made ten character date
  1420.       field but you can define one with the "Formatted Text" field
  1421.       type.
  1422.  
  1423.  
  1424.       See Also:-   Makedate
  1425.  
  1426.  
  1427.  
  1428.  
  1429.  
  1430.  
  1431.  
  1432.  
  1433.  
  1434.  
  1435.  
  1436.  
  1437.  
  1438.  
  1439.  
  1440.  
  1441.  
  1442.  
  1443.  
  1444.  
  1445.  
  1446.  
  1447.  
  1448.  
  1449.  
  1450.  
  1451.  
  1452.  
  1453.                                 - 22 -
  1454. ................................................................................
  1455.       DATETEXT                   FUNCTION                    DATETEXT
  1456.  
  1457.       This function returns the date parameter in the form:-
  1458.  
  1459.       14th October 1994  or
  1460.       October 14th 1994  depending on the date format selected in
  1461.                          the utilities menu.
  1462.  
  1463.  
  1464.       Ex.    datetext(system date)
  1465.  
  1466.       Ex.    datetext(invoicedate + 30)
  1467.  
  1468.       Acceptable parameters:
  1469.  
  1470.       System date
  1471.       Date field
  1472.       Makedate function
  1473.       Date expression
  1474.  
  1475.  
  1476.  
  1477.  
  1478.  
  1479.  
  1480.  
  1481.  
  1482.  
  1483.  
  1484.  
  1485.  
  1486.  
  1487.  
  1488.  
  1489.  
  1490.  
  1491.  
  1492.  
  1493.  
  1494.  
  1495.  
  1496.  
  1497.  
  1498.  
  1499.  
  1500.  
  1501.  
  1502.  
  1503.  
  1504.  
  1505.  
  1506.  
  1507.  
  1508.  
  1509.  
  1510.                                 - 23 -
  1511. ................................................................................
  1512.       DAYOFMONTH                 FUNCTION                  DAYOFMONTH
  1513.  
  1514.       This function returns the day no.(1-31) of the date parameter.
  1515.  
  1516.       Ex. dayofmonth(system date)
  1517.  
  1518.       Ex  dayofmonth(registered)
  1519.  
  1520.       Ex.
  1521.  
  1522.       if dayofmonth(system date) = 28 then
  1523.          for statements with settled = "No"
  1524.             statements.overdue = "Yes"
  1525.             update record
  1526.          next
  1527.       end if
  1528.  
  1529.       Acceptable parameters:
  1530.  
  1531.       System date
  1532.       Date field
  1533.       Makedate function
  1534.       Date expression
  1535.  
  1536.  
  1537.  
  1538.  
  1539.  
  1540.  
  1541.  
  1542.  
  1543.  
  1544.  
  1545.  
  1546.  
  1547.  
  1548.  
  1549.  
  1550.  
  1551.  
  1552.  
  1553.  
  1554.  
  1555.  
  1556.  
  1557.  
  1558.  
  1559.  
  1560.  
  1561.  
  1562.  
  1563.  
  1564.  
  1565.  
  1566.  
  1567.                                 - 24 -
  1568. ................................................................................
  1569.       DAYOFWEEK                  FUNCTION                   DAYOFWEEK
  1570.  
  1571.       This function returns the day no.(1-7) of the date parameter.
  1572.  
  1573.       Ex.  dayofweek(system date)
  1574.  
  1575.       Ex.  day = spellday(dayofweek(diary.date))
  1576.  
  1577.       Ex.  The following procedure, if called from a batch execute
  1578.       menu will only run on a Monday.
  1579.  
  1580.       declare output fields
  1581.          takings.date
  1582.          takings.dailytotal
  1583.       end
  1584.       if dayofweek(system date) = 1 then
  1585.          for takings with date in reverse order
  1586.             print list items
  1587.             if system date - takings.date > 7 then exit for
  1588.          next
  1589.       end if
  1590.  
  1591.       Acceptable parameters:
  1592.  
  1593.       System date
  1594.       Date field
  1595.       Makedate function
  1596.       Date expression
  1597.  
  1598.  
  1599.  
  1600.  
  1601.  
  1602.  
  1603.  
  1604.  
  1605.  
  1606.  
  1607.  
  1608.  
  1609.  
  1610.  
  1611.  
  1612.  
  1613.  
  1614.  
  1615.  
  1616.  
  1617.  
  1618.  
  1619.  
  1620.  
  1621.  
  1622.  
  1623.  
  1624.                                 - 25 -
  1625. ................................................................................
  1626.       DAYOFYEAR                  FUNCTION                   DAYOFYEAR
  1627.  
  1628.       This function returns the day no.(1-365) of the date parameter.
  1629.  
  1630.       Ex.   dayofyear(system date)
  1631.  
  1632.       Ex.   days = dayofyear(events.date)
  1633.  
  1634.       Acceptable parameters:
  1635.  
  1636.       System date
  1637.       Date field
  1638.       Makedate function
  1639.       Date expression
  1640.  
  1641.  
  1642.  
  1643.  
  1644.  
  1645.  
  1646.  
  1647.  
  1648.  
  1649.  
  1650.  
  1651.  
  1652.  
  1653.  
  1654.  
  1655.  
  1656.  
  1657.  
  1658.  
  1659.  
  1660.  
  1661.  
  1662.  
  1663.  
  1664.  
  1665.  
  1666.  
  1667.  
  1668.  
  1669.  
  1670.  
  1671.  
  1672.  
  1673.  
  1674.  
  1675.  
  1676.  
  1677.  
  1678.  
  1679.  
  1680.  
  1681.                                 - 26 -
  1682. ................................................................................
  1683.       DECLARE                PROCEDURE COMMAND                DECLARE
  1684.  
  1685.       If you write a procedure which outputs information to the
  1686.       screen, printer or a disk file you must start it by declaring
  1687.       the output fields.
  1688.  
  1689.       Ex.
  1690.       Declare output fields
  1691.          Input.name
  1692.          Customers.name:customers.address:customers.acno
  1693.          countofinvoices
  1694.       end
  1695.  
  1696.       If fields you intend to print exist in a form then declare them
  1697.       as Formname.Fieldname.  Fields from the procedures Input Screen
  1698.       are declared as Input.fieldname. Easy Base will then use the
  1699.       field definitions from the form as defaults when you create the
  1700.       Output Format for the procedure.
  1701.  
  1702.       If a field which you intend to print is to be derived during
  1703.       the procedure and does not exist in a form as "countofinvoices"
  1704.       you can give it any name you wish up to forty characters but
  1705.       the name must not contain a ".". Once you have declared fields
  1706.       you can create the Output Format.
  1707.  
  1708.       If you declare an "Ad Hoc" field such as "countovinvoices" then
  1709.       you must include it in the format in order to define its type
  1710.       and length.
  1711.  
  1712.       If you require variables to store values during a procedure but
  1713.       you will not be out-putting their values then declare them as
  1714.       variables not fields.
  1715.  
  1716.       Ex.
  1717.  
  1718.       declare variables
  1719.          count as number
  1720.          lasttype as text
  1721.       end
  1722.  
  1723.       Unprinted variables can only have one of the two types "Number"
  1724.       or "Text".
  1725.  
  1726.       Field declarations must precede Variable declarations and both
  1727.       must precede executable code.
  1728.  
  1729.  
  1730.  
  1731.  
  1732.  
  1733.  
  1734.  
  1735.  
  1736.  
  1737.  
  1738.                                 - 27 -
  1739. ................................................................................
  1740.       DEFAULT                    FUNCTION                     DEFAULT
  1741.  
  1742.       This function returns the parameter if not overridden by user
  1743.       entry.
  1744.  
  1745.  
  1746.       Ex.    Default(5)
  1747.  
  1748.       Ex.    Default(system date)
  1749.  
  1750.       Ex.    Default(lookup(stock,price))
  1751.  
  1752.       The Default function is only used in form and input screen
  1753.       field derivations - It has no meaning in procedure code.
  1754.  
  1755.       Acceptable parameters
  1756.  
  1757.       Any value, expression, field, variable or nested function of
  1758.       the same type as the field in which it is used.
  1759.  
  1760.  
  1761.  
  1762.  
  1763.  
  1764.  
  1765.  
  1766.  
  1767.  
  1768.  
  1769.  
  1770.  
  1771.  
  1772.  
  1773.  
  1774.  
  1775.  
  1776.  
  1777.  
  1778.  
  1779.  
  1780.  
  1781.  
  1782.  
  1783.  
  1784.  
  1785.  
  1786.  
  1787.  
  1788.  
  1789.  
  1790.  
  1791.  
  1792.  
  1793.  
  1794.  
  1795.                                 - 28 -
  1796. ................................................................................
  1797.       DELAY                    FIELD CONTROL                    DELAY
  1798.  
  1799.       The "delay" control suspends processing for a given number of
  1800.       milliseconds.
  1801.  
  1802.       Ex.
  1803.  
  1804.       A procedure screen is used from a startup Batch execute menu as
  1805.       an opening screen to an application and has the following field
  1806.       derivations
  1807.  
  1808.       1.  "Welcome to this wonderful program" [delay 1000]
  1809.  
  1810.       2.  "Copyright Fred blogs"[delay 1000]
  1811.  
  1812.       3.  "Press F2 to start"
  1813.  
  1814.       If the field colours are "text" ,"alt1" or "alt2" then the
  1815.       three fields will "Popup" with a one second delay between each.
  1816.  
  1817.  
  1818.  
  1819.  
  1820.  
  1821.  
  1822.  
  1823.  
  1824.  
  1825.  
  1826.  
  1827.  
  1828.  
  1829.  
  1830.  
  1831.  
  1832.  
  1833.  
  1834.  
  1835.  
  1836.  
  1837.  
  1838.  
  1839.  
  1840.  
  1841.  
  1842.  
  1843.  
  1844.  
  1845.  
  1846.  
  1847.  
  1848.  
  1849.  
  1850.  
  1851.  
  1852.                                 - 29 -
  1853. ................................................................................
  1854.       DELAY                  PROCEDURE COMMAND                  DELAY
  1855.  
  1856.       The "Delay" command suspends processing for a given number of
  1857.       milliseconds (1 - 5000).
  1858.  
  1859.       Ex.
  1860.  
  1861.       declare variables
  1862.          x as number : total as number
  1863.       end
  1864.       for customers
  1865.          customers.balance = 0
  1866.          for invoices with acno = customers.acno
  1867.             display status "Totalling invoices for" + Customers.name
  1868.             delay 200
  1869.             customers.balance = customers.balance + invoices.total
  1870.          next
  1871.          update record
  1872.       next
  1873.  
  1874.       In the above example, wherever a customer only has one or two
  1875.       invoices to total, the status display would change very
  1876.       quickly.  By including a 200 millisecond delay you can ensure
  1877.       that each customers name is on screen at least long enough to
  1878.       be read.
  1879.  
  1880.       Delay values outside of 1 - 5000 are ignored.
  1881.       The delay parameter cannot be supplied as a variable.
  1882.  
  1883.  
  1884.  
  1885.  
  1886.  
  1887.  
  1888.  
  1889.  
  1890.  
  1891.  
  1892.  
  1893.  
  1894.  
  1895.  
  1896.  
  1897.  
  1898.  
  1899.  
  1900.  
  1901.  
  1902.  
  1903.  
  1904.  
  1905.  
  1906.  
  1907.  
  1908.  
  1909.                                 - 30 -
  1910. ................................................................................
  1911.       DELETE CHOICE LISTS        UTILITY          DELETE CHOICE LISTS
  1912.  
  1913.       If you have Choice lists for choice fields that are no longer
  1914.       required you can delete them with this utility.
  1915.  
  1916.  
  1917.  
  1918.  
  1919.  
  1920.  
  1921.  
  1922.  
  1923.  
  1924.  
  1925.  
  1926.  
  1927.  
  1928.  
  1929.  
  1930.  
  1931.  
  1932.  
  1933.  
  1934.  
  1935.  
  1936.  
  1937.  
  1938.  
  1939.  
  1940.  
  1941.  
  1942.  
  1943.  
  1944.  
  1945.  
  1946.  
  1947.  
  1948.  
  1949.  
  1950.  
  1951.  
  1952.  
  1953.  
  1954.  
  1955.  
  1956.  
  1957.  
  1958.  
  1959.  
  1960.  
  1961.  
  1962.  
  1963.  
  1964.  
  1965.  
  1966.                                 - 31 -
  1967. ................................................................................
  1968.       DELETE RECORD          PROCEDURE COMMAND          DELETE RECORD
  1969.  
  1970.       The "Delete Record" command is used for the selective deletion
  1971.       of records in a form.
  1972.  
  1973.       Ex.
  1974.  
  1975.       for books with title = input.title
  1976.          delete record
  1977.       next
  1978.  
  1979.       This deletes the single book whose title is that entered on the
  1980.       input screen.
  1981.  
  1982.       for books with author = input.author
  1983.          delete record
  1984.       next
  1985.  
  1986.       This deletes the records of all books by the author entered on
  1987.       the input screen.
  1988.  
  1989.       When you use the "Delete Record" command it has the same effect
  1990.       as deleting a record in data entry. In other words the record
  1991.       is marked for deletion but will not actually be removed from
  1992.       the form until the next re-pack.
  1993.  
  1994.       If you use the "Delete Record" command to delete large numbers
  1995.       of records then you should pack the form afterward.
  1996.  
  1997.       If you wish to delete all records in a form use the "Clear
  1998.       records" command not the "Delete Record" command.
  1999.  
  2000.  
  2001.  
  2002.  
  2003.  
  2004.  
  2005.  
  2006.  
  2007.  
  2008.  
  2009.  
  2010.  
  2011.  
  2012.  
  2013.  
  2014.  
  2015.  
  2016.  
  2017.  
  2018.  
  2019.  
  2020.  
  2021.  
  2022.  
  2023.                                 - 32 -
  2024. ................................................................................
  2025.       DERIVE OFF             PROCEDURE COMMAND             DERIVE OFF
  2026.  
  2027.       Whenever an Easy Base procedure adds or updates a record then
  2028.       by default it checks the derivations of all fields during an
  2029.       add operation and any fields that are affected by an update
  2030.       operation. In other words, if you update the netprice field in
  2031.       a stock form and that form has derived fields for VAT and
  2032.       grossprice then those fields will also be updated.
  2033.  
  2034.       If the procedure adds or updates all fields then this process
  2035.       is superfluous and simply slows the procedure. You can disable
  2036.       form derivation checking with the "Derive Off" command.
  2037.  
  2038.       derive off
  2039.       for stock with item = input.item
  2040.          copy all from input
  2041.          update record
  2042.       next
  2043.  
  2044.       In the above example a stock form has several derived fields
  2045.       but the input screen also does the same derivations. There is
  2046.       therefore no need to re-check them when the record is updated.
  2047.  
  2048.       As a general rule, in procedures which add or update records
  2049.       from an input screen, you should derive all fields on the input
  2050.       screen rather than during the update process. The user will not
  2051.       notice the time taken to derive fields while he is filling them
  2052.       in but he will notice the time taken to derive them after he
  2053.       has pressed F2
  2054.  
  2055.       There is no corresponding "Derive On" command. Derivation
  2056.       checking is automatically turned back on at the end of the
  2057.       loop to which is prefixed by the "Derive Off" command. If you
  2058.       require derivation checking to be off for more than one loop in
  2059.       a procedure then you must issue the command before each loop.
  2060.  
  2061.  
  2062.       Note:-
  2063.  
  2064.       If the "Derive Off" command is not issued before a loop then
  2065.       form level derivations override procedure derivations. This is
  2066.       not normally a problem, but can be if you try to change the
  2067.       case of a field for printing.
  2068.  
  2069.       For customers
  2070.          customers.name = proper(customers.name)
  2071.          print list items
  2072.       next
  2073.  
  2074.       If the "Name" field on the "Customers" form is derived as
  2075.       Upper(name) then the procedure will print the customers names
  2076.       in upper case.  You can overcome the problem either by
  2077.       cancelling the field derivation or by transferring the
  2078.       customers name to a variable and converting that to proper.
  2079.  
  2080.                                 - 33 -
  2081. ................................................................................
  2082.       Disable                DERIVATION PREFIX                Disable
  2083.  
  2084.       When an Easy Base procedure has an input screen it can be run
  2085.       by pressing any of the function keys 2,4,5,7,8,9 or 10.
  2086.  
  2087.       Where a procedure only does one job, the fact that all keys
  2088.       will initiate it is not important. The default help line states
  2089.       F2 and you can replace this if you want the user to use
  2090.       another.
  2091.  
  2092.       If however you wish to disable function keys which your
  2093.       procedure does not use you can do so by adding the prefix
  2094.       "Disable" followed by the keys you wish to deactivate in
  2095.       quotation marks. You can also disable the Escape Key.
  2096.  
  2097.       Ex.
  2098.  
  2099.       Disable "5789"
  2100.  
  2101.       It does not matter which field you use the "Disable" prefix in
  2102.       and if the field already has a derivation formula it can
  2103.       follow.
  2104.  
  2105.       Disable "4578910Esc" lookup(units,price)
  2106.  
  2107.       In the above example the only active function key is F2 and the
  2108.       user cannot Escape to the menu. The procedure must be run.
  2109.  
  2110.       Disabling the Escape key is useful where a procedure is part of
  2111.       a chain, ie it is run by the run command from a main procedure
  2112.       or it is on a batch menu. You should be careful not to disable
  2113.       the Escape key on procedures that are stand alone with
  2114.       repeating input screens or on main procedures which run other
  2115.       procedures which in turn run the main procedure.
  2116.  
  2117.       Notes:
  2118.  
  2119.       1.  The Disable prefix has no meaning in data entry forms.
  2120.  
  2121.       2.  There must be a space between "Disable" and the key string.
  2122.           The key string must be in quotation marks.
  2123.  
  2124.       3.  You can combine prefixes in any field derivation provided
  2125.           there is a space between them
  2126.  
  2127.       Ex.
  2128.  
  2129.       Disable "4578910" Help "Press F2 when ready" Start Here
  2130.  
  2131.  
  2132.       See also: "Run" "Fun_Key" "Dissable Control"
  2133.  
  2134.  
  2135.  
  2136.  
  2137.                                 - 34 -
  2138. ................................................................................
  2139.       Disable                  FIELD CONTROL                  Disable
  2140.  
  2141.       The Disable control is used to change the disabled function
  2142.       keys from within field derivations in a procedure's input
  2143.       screen.
  2144.  
  2145.       Ex.
  2146.  
  2147.       if(actn = "new",actn[disable "4578910"],actn[disable "2"])
  2148.  
  2149.  
  2150.  
  2151.  
  2152.  
  2153.  
  2154.  
  2155.  
  2156.  
  2157.  
  2158.  
  2159.  
  2160.  
  2161.  
  2162.  
  2163.  
  2164.  
  2165.  
  2166.  
  2167.  
  2168.  
  2169.  
  2170.  
  2171.  
  2172.  
  2173.  
  2174.  
  2175.  
  2176.  
  2177.  
  2178.  
  2179.  
  2180.  
  2181.  
  2182.  
  2183.  
  2184.  
  2185.  
  2186.  
  2187.  
  2188.  
  2189.  
  2190.  
  2191.  
  2192.  
  2193.  
  2194.                                 - 35 -
  2195. ................................................................................
  2196.       DISPLAY STATUS         PROCEDURE COMMAND         DISPLAY STATUS
  2197.  
  2198.       If you write a procedure which has no output then Easy Base
  2199.       will display a "Running" flash at the top right hand side of
  2200.       the screen. For procedures which only take a few seconds to run
  2201.       this is sufficient to let the operator know that something is
  2202.       happening. For procedures that take some time to complete you
  2203.       should include a status display showing the progress of the
  2204.       procedure. A status display not only allays the nagging
  2205.       suspicion that the system has hung up but also allows the
  2206.       operator to estimate how long it will take.
  2207.  
  2208.       To create a status display just issue the command "Display
  2209.       Status" followed by a message composed of text in quotation
  2210.       marks and fields or variables concatenated by the + sign.
  2211.  
  2212.       Ex.
  2213.  
  2214.  
  2215.       declare variables
  2216.          x as number : y as number
  2217.       end
  2218.       for employees with taxcode = input.oldtaxcode
  2219.          y = employees.total copies :exit for
  2220.       next
  2221.       for employees with taxcode = input.oldtaxcode
  2222.          x = x + 1
  2223.          display status "Updating Record" + x + "of" + y
  2224.          employees.taxcode = input.newtaxcode
  2225.          update record
  2226.       next
  2227.  
  2228.       The status line is displayed centrally in a small window when
  2229.       the procedure runs. A Status line can have a maximum of 68
  2230.       characters. If you create a status line of more than 68
  2231.       characters then it will be cut short to that length.
  2232.  
  2233.       If you need to display counters in two nested loops then write
  2234.       the full display line in the outer loop and "display status"
  2235.       with no parameters in the inner loop.
  2236.  
  2237.       for customers
  2238.          x = x + 1
  2239.          - loop statements -
  2240.          display status "Checking Invoice" + y + "of customer" + x
  2241.          for invoices with customer = customers.name
  2242.             y = y + 1
  2243.             - Loop Statements -
  2244.             display status
  2245.          next
  2246.       next
  2247.  
  2248.  
  2249.  
  2250.  
  2251.                                 - 36 -
  2252. ................................................................................
  2253.       DO..LOOP               PROCEDURE COMMAND               DO..LOOP
  2254.  
  2255.       The "Do" loop structure is used in the Easy Base Procedure code
  2256.       to repeat a series of commands or statements. Whenever a
  2257.       procedure reaches a "Do" command it repeats all the statements
  2258.       between the "Do" and the "Loop" statements until the loop is
  2259.       broken by an "Exit Do" command.
  2260.  
  2261.       Ex.
  2262.  
  2263.       The following code fragment prints 10 copies of the top fifty
  2264.       best selling items in a "stock" form.
  2265.  
  2266.  
  2267.       .........................code............................
  2268.       declare output fields
  2269.          stock.item : stock.sales : today
  2270.       end
  2271.       Declare variables
  2272.          copies as number : items as number
  2273.       end
  2274.       today = system date
  2275.       do
  2276.          copies = copies + 1 :items = 0
  2277.          if copies = 11 then exit do
  2278.          bold on
  2279.          print report header
  2280.          bold off
  2281.          for stock with sales in reverse order
  2282.             items = items + 1
  2283.             if items = 51 then exit for
  2284.             print list items
  2285.          next
  2286.          bold on : print report footer : bold off
  2287.          page feed
  2288.       loop
  2289.       ............................format.....................
  2290.       .Report Header
  2291.          ═════════════════════════════════════════════════════
  2292.          Top 50 Best Selling Items               {today field}
  2293.          ═════════════════════════════════════════════════════
  2294.       .list items
  2295.             {stock.item field}        {stock.sales field}
  2296.       .Report Footer
  2297.          ═════════════════════════════════════════════════════
  2298.       .end
  2299.  
  2300.  
  2301.  
  2302.  
  2303.  
  2304.  
  2305.  
  2306.  
  2307.  
  2308.                                 - 37 -
  2309. ................................................................................
  2310.       Erase                    File Command                     Erase
  2311.  
  2312.       The "Erase" command erases files. It accepts wildcard
  2313.       parameters.
  2314.  
  2315.       ex.
  2316.  
  2317.       Erase "C:\letters\*.doc"
  2318.  
  2319.       Ex.
  2320.  
  2321.       index off
  2322.       For faxlog with date < system date - 30
  2323.          erase jointext("C:\Fax\",faxlog.filename)
  2324.          delete record
  2325.       next
  2326.  
  2327.  
  2328.  
  2329.  
  2330.  
  2331.  
  2332.  
  2333.  
  2334.  
  2335.  
  2336.  
  2337.  
  2338.  
  2339.  
  2340.  
  2341.  
  2342.  
  2343.  
  2344.  
  2345.  
  2346.  
  2347.  
  2348.  
  2349.  
  2350.  
  2351.  
  2352.  
  2353.  
  2354.  
  2355.  
  2356.  
  2357.  
  2358.  
  2359.  
  2360.  
  2361.  
  2362.  
  2363.  
  2364.  
  2365.                                 - 38 -
  2366. ................................................................................
  2367.       ESCAPE ON/OFF          PROCEDURE COMMAND          ESCAPE ON/OFF
  2368.  
  2369.       When a procedure is running in Easy Base, it cannot, by
  2370.       default, be interrupted. If your procedure simply lists data to
  2371.       the screen then the end user may not need to see the entire
  2372.       output. You can allow the user to terminate a procedure
  2373.       prematurely with the "Escape On" command.
  2374.  
  2375.       If a procedure performs several tasks, you can selectively
  2376.       enable and disable the Escape Key with the commands "Escape On"
  2377.       and "Escape" Off"
  2378.  
  2379.       Ex.
  2380.  
  2381.       For newpayscales
  2382.          print list items
  2383.       next
  2384.       escape off
  2385.       for newpayscales
  2386.          for employees with scale = newpayscales.scale
  2387.             employees.rate = newpayscales.rate
  2388.             update record
  2389.          next
  2390.       next
  2391.       escape on
  2392.       for employees
  2393.          print newpay
  2394.       next
  2395.  
  2396.       In the above example a procedure lists new pay scales, updates
  2397.       the "Employees" form with the new pay rate and then lists the
  2398.       employees with their new rates.
  2399.  
  2400.       While the procedure is running the operator can terminate it
  2401.       during either of the lists but he cannot terminate it during
  2402.       the process of updating the "Employees" form.
  2403.  
  2404.       See also: Pause On/Off
  2405.  
  2406.  
  2407.  
  2408.  
  2409.  
  2410.  
  2411.  
  2412.  
  2413.  
  2414.  
  2415.  
  2416.  
  2417.  
  2418.  
  2419.  
  2420.  
  2421.  
  2422.                                 - 39 -
  2423. ................................................................................
  2424.       EXIT BATCH MENU        PROCEDURE COMMAND        EXIT BATCH MENU
  2425.  
  2426.       The "Exit Batch Menu" command terminates a current Batch Menu
  2427.       and returns control to the menu which called it.
  2428.  
  2429.       Ex.
  2430.  
  2431.       An application starts with a batch menu which calls a second
  2432.       batch menu which performs regular daily tasks. It then calls
  2433.       the main user menu. If the application is exited after the
  2434.       daily tasks batch menu has been completed then you will not
  2435.       wish to re-run the daily tasks when the application is
  2436.       restarted on the same day. To prevent this create a form
  2437.       "tasksdone" with a single field "date" and enter a single
  2438.       record with yesterdays date.
  2439.  
  2440.       The first procedure on the daily tasks batch menu would then be
  2441.  
  2442.       for tasksdone
  2443.          if tasksdone.date = system date then
  2444.             exit batch menu
  2445.          else
  2446.             tasksdone.date = system date
  2447.             update record
  2448.          end if
  2449.       next
  2450.  
  2451.  
  2452.  
  2453.  
  2454.  
  2455.  
  2456.  
  2457.  
  2458.  
  2459.  
  2460.  
  2461.  
  2462.  
  2463.  
  2464.  
  2465.  
  2466.  
  2467.  
  2468.  
  2469.  
  2470.  
  2471.  
  2472.  
  2473.  
  2474.  
  2475.  
  2476.  
  2477.  
  2478.  
  2479.                                 - 40 -
  2480. ................................................................................
  2481.       EXIT PROCEDURE         PROCEDURE COMMAND         EXIT PROCEDURE
  2482.  
  2483.       The "Exit Procedure" command terminates a procedure.
  2484.  
  2485.       Ex.
  2486.  
  2487.       if input.codeword <> "fred" then exit procedure
  2488.       for staffconfidential with name = input.name
  2489.          print list items
  2490.       next
  2491.  
  2492.  
  2493.       If the procedure has a repeating input screen then this is
  2494.       cancelled by the "Exit Procedure" command.
  2495.  
  2496.  
  2497.  
  2498.  
  2499.  
  2500.  
  2501.  
  2502.  
  2503.  
  2504.  
  2505.  
  2506.  
  2507.  
  2508.  
  2509.  
  2510.  
  2511.  
  2512.  
  2513.  
  2514.  
  2515.  
  2516.  
  2517.  
  2518.  
  2519.  
  2520.  
  2521.  
  2522.  
  2523.  
  2524.  
  2525.  
  2526.  
  2527.  
  2528.  
  2529.  
  2530.  
  2531.  
  2532.  
  2533.  
  2534.  
  2535.  
  2536.                                 - 41 -
  2537. ................................................................................
  2538.       File_Date File_Time      System value       File_Date File_Time
  2539.  
  2540.       Whenever you open a non Easy Base file it's date and time stamp
  2541.       are available in the system values File_Date and File_Time.
  2542.  
  2543.  
  2544.  
  2545.  
  2546.  
  2547.  
  2548.  
  2549.  
  2550.  
  2551.  
  2552.  
  2553.  
  2554.  
  2555.  
  2556.  
  2557.  
  2558.  
  2559.  
  2560.  
  2561.  
  2562.  
  2563.  
  2564.  
  2565.  
  2566.  
  2567.  
  2568.  
  2569.  
  2570.  
  2571.  
  2572.  
  2573.  
  2574.  
  2575.  
  2576.  
  2577.  
  2578.  
  2579.  
  2580.  
  2581.  
  2582.  
  2583.  
  2584.  
  2585.  
  2586.  
  2587.  
  2588.  
  2589.  
  2590.  
  2591.  
  2592.  
  2593.                                 - 42 -
  2594. ................................................................................
  2595.       File_Len                 System Value                  File_Len
  2596.  
  2597.       Whenever you open an external file with the "Open" Command the
  2598.       length of the opened file is available in the system value
  2599.       File_Len.
  2600.  
  2601.       The main use of the File_Len value is to position the
  2602.       Read/Write pointer ready to append data to an existing file.
  2603.  
  2604.       ...................
  2605.       declare variables
  2606.          CR as text
  2607.       end
  2608.       CR = jointext(chr$(13),chr$(10))
  2609.       Open "C:\WP\Address.txt"
  2610.       seek File_Len + 1
  2611.       Write Input.name
  2612.       Write CR
  2613.       Write Input.address1
  2614.       Write CR
  2615.       Write Input.address2
  2616.       Write CR
  2617.       Write input.address3
  2618.       Write CR
  2619.       Close
  2620.  
  2621.  
  2622.  
  2623.  
  2624.  
  2625.  
  2626.  
  2627.  
  2628.  
  2629.  
  2630.  
  2631.  
  2632.  
  2633.  
  2634.  
  2635.  
  2636.  
  2637.  
  2638.  
  2639.  
  2640.  
  2641.  
  2642.  
  2643.  
  2644.  
  2645.  
  2646.  
  2647.  
  2648.  
  2649.  
  2650.                                 - 43 -
  2651. ................................................................................
  2652.       File_Pos                 System Value                  File_Pos
  2653.  
  2654.       Whenever you open an external file with the "Open" command,
  2655.       The position of the file read/write pointer is available in the
  2656.       system value File_Pos.
  2657.  
  2658.       The value is in bytes counting the first byte as 1.
  2659.  
  2660.       The File_Pos value is used to make relative movements of the
  2661.       Read/write pointer  with the "Seek" command
  2662.  
  2663.       .....................................
  2664.       Open "C:\myfiles\Report.txt"
  2665.       for reports new record
  2666.          Read 10 to reports.CustNo
  2667.          Seek File_pos + 3
  2668.          read 20 to reports.Custname
  2669.       next
  2670.       close
  2671.       ......................................
  2672.  
  2673.       You can move the Read/Write pointer in either direction.
  2674.  
  2675.       Seek File_Pos - 20
  2676.  
  2677.       If you move the pointer back beyond the start of the file Easy
  2678.       Base generates the error message "Seek Value < 1 !".
  2679.  
  2680.  
  2681.       See Also: Open, Close, Seek, Read, Write
  2682.  
  2683.  
  2684.  
  2685.  
  2686.  
  2687.  
  2688.  
  2689.  
  2690.  
  2691.  
  2692.  
  2693.  
  2694.  
  2695.  
  2696.  
  2697.  
  2698.  
  2699.  
  2700.  
  2701.  
  2702.  
  2703.  
  2704.  
  2705.  
  2706.  
  2707.                                 - 44 -
  2708. ................................................................................
  2709.       Find                     File Command                      Find
  2710.  
  2711.       The "Find" command is used to select non Easy Base files using
  2712.       a wildcard Spec. When you issue the command Find with a
  2713.       wildspec parameter, Easy Base finds the first file to match the
  2714.       spec and puts its name in the Found_File system value. If you
  2715.       then repeat the command without a spec, Easy Base finds the
  2716.       next matching filename and puts it in Found_File. When all
  2717.       files have been found the Found_File value reverts to "Blank".
  2718.  
  2719.       Example: A company recieves replacement part orders by FAX.
  2720.       After the Address lines the FAX is formatted in four lines
  2721.  
  2722.       "Order Start:" - Engineers ID - Part ID - Quantity.
  2723.  
  2724.       All incoming FAXes for parts are filed in C:\FAX\ORDERS.
  2725.  
  2726.       The following procedure imports the orders to the Orders form
  2727.       and then deletes the FAX files.
  2728.  
  2729.       Declare variables
  2730.          Ln as text
  2731.       end
  2732.       Find "C:\FAX\ORDERS\*.*"
  2733.       Do
  2734.          If Found_File = Blank then exit do
  2735.          For orders new record
  2736.             open jointext("C:\FAX\ORDERS\",Found_File)
  2737.             Do
  2738.                Read line to Ln
  2739.                If Ln = "Order start:" then exit do
  2740.             Loop
  2741.             Read line to orders.engineer
  2742.             Read line to order.part
  2743.             read line to orders.quantity
  2744.          next
  2745.          Close
  2746.          Find
  2747.       Loop
  2748.       Erase "C:\FAX\ORDERS\*.*"
  2749.  
  2750.  
  2751.  
  2752.  
  2753.  
  2754.  
  2755.  
  2756.  
  2757.  
  2758.  
  2759.  
  2760.  
  2761.  
  2762.  
  2763.  
  2764.                                 - 45 -
  2765. ................................................................................
  2766.       FIXED POINT               FIELD TYPE                FIXED POINT
  2767.  
  2768.       Fixed point fields can display up to 14 digits. They use the
  2769.       comma for thousands separation and the full stop for decimal
  2770.       separation.
  2771.  
  2772.       There are no rounding errors with fixed point fields.
  2773.  
  2774.       See - Operators arithmetic
  2775.  
  2776.  
  2777.  
  2778.  
  2779.  
  2780.  
  2781.  
  2782.  
  2783.  
  2784.  
  2785.  
  2786.  
  2787.  
  2788.  
  2789.  
  2790.  
  2791.  
  2792.  
  2793.  
  2794.  
  2795.  
  2796.  
  2797.  
  2798.  
  2799.  
  2800.  
  2801.  
  2802.  
  2803.  
  2804.  
  2805.  
  2806.  
  2807.  
  2808.  
  2809.  
  2810.  
  2811.  
  2812.  
  2813.  
  2814.  
  2815.  
  2816.  
  2817.  
  2818.  
  2819.  
  2820.  
  2821.                                 - 46 -
  2822. ................................................................................
  2823.       FLOATING POINT            FIELD TYPE             FLOATING POINT
  2824.  
  2825.       Floating point fields can display up to 14 digits. They do not
  2826.       have a thousands separator. They are left justified.
  2827.  
  2828.  
  2829.  
  2830.  
  2831.  
  2832.  
  2833.  
  2834.  
  2835.  
  2836.  
  2837.  
  2838.  
  2839.  
  2840.  
  2841.  
  2842.  
  2843.  
  2844.  
  2845.  
  2846.  
  2847.  
  2848.  
  2849.  
  2850.  
  2851.  
  2852.  
  2853.  
  2854.  
  2855.  
  2856.  
  2857.  
  2858.  
  2859.  
  2860.  
  2861.  
  2862.  
  2863.  
  2864.  
  2865.  
  2866.  
  2867.  
  2868.  
  2869.  
  2870.  
  2871.  
  2872.  
  2873.  
  2874.  
  2875.  
  2876.  
  2877.  
  2878.                                 - 47 -
  2879. ................................................................................
  2880.       FOR..NEXT              PROCEDURE COMMAND              FOR..NEXT
  2881.  
  2882.       The "For" command initiates loops which load records from forms
  2883.       for processing. All statements between the "For" and the "Next"
  2884.       commands are repeated for each record selected.
  2885.  
  2886.       Ex.
  2887.  
  2888.       For Videos
  2889.          If Videos.price = 2.00 then Videos.price = 2.50
  2890.          update record
  2891.       next
  2892.  
  2893.       In the above example each record in the "Videos" form is loaded
  2894.       into memory - the price field is checked and if it is 2.00 then
  2895.       it is altered to 2.50 - the record is then updated on disk.
  2896.  
  2897.       "For" loops can be nested to any depth.
  2898.  
  2899.       Ex.
  2900.  
  2901.       for videoprices
  2902.          for videos
  2903.             if videos.price = videoprices.price then
  2904.                print list items
  2905.             end if
  2906.          next
  2907.       next
  2908.  
  2909.       In the above example the outer loop loads each record from the
  2910.       "Videoprices" form.  While each of these is in memory it then
  2911.       loads each record from the "Videos" form, tests to see if the
  2912.       price field in "Videos" is the same as the price field in
  2913.       "Videoprices" and if so prints the list items section of the
  2914.       report format (containing the video title field) thus grouping
  2915.       all video titles by price.
  2916.  
  2917.       If a "For" loop is unqualified as above then every record is
  2918.       processed starting at one and advancing in sequence. "For"
  2919.       loops can be qualified in several ways in order to select
  2920.       records in other orders or groups. The following qualifications
  2921.       are available:-
  2922.  
  2923.       For (form) with (fieldname) in order
  2924.       For (form) with (fieldname) in reverse order
  2925.       For (form) with (fieldname) =  (value)
  2926.       For (form) with (fieldname) >  (value)
  2927.       For (form) with (fieldname) <  (value)
  2928.       For (form) with (fieldname) >= (value)
  2929.       For (form) with (fieldname) <= (value)
  2930.       For (form) new record
  2931.  
  2932.       With the exception of the "New Record" qualification, all
  2933.       accept the suffix "Unique" and an "Alias" for the form name.
  2934.  
  2935.                                 - 48 -
  2936. ................................................................................
  2937.       FOR..NEXT              PROCEDURE COMMAND              FOR..NEXT
  2938.  
  2939.       If a "For" loop is qualified by "in order" or "in reverse
  2940.       order" then the records are selected in alphabetical or reverse
  2941.       alphabetical order if the selection field is text, and in
  2942.       numeric or reverse numeric order if the selection field is
  2943.       numeric.
  2944.  
  2945.       Ex.
  2946.  
  2947.       for books with title in order
  2948.          print list items
  2949.       next
  2950.  
  2951.       Ex.
  2952.  
  2953.       for salesmen with monthlysales in reverse order
  2954.          print list items
  2955.       next
  2956.  
  2957.       If a "For" loop is qualified by "in order unique" or "in
  2958.       reverse order unique" then records will be selected in order or
  2959.       in reverse order as above. However, where there are multiple
  2960.       occurrence of the same field value a "unique" loop will only
  2961.       select the first occurrence of each value if the loop is in
  2962.       order or the last occurrence if the loop is in reverse order.
  2963.  
  2964.       Ex.
  2965.  
  2966.       for books with category in order unique
  2967.          count = count + 1
  2968.          print list items
  2969.       next
  2970.       print categorycount
  2971.  
  2972.       This example prints and counts the different categories in the
  2973.       "books" form.
  2974.  
  2975.       Ex.
  2976.  
  2977.       for theatreseats with price in reverse order unique
  2978.          for seatprices new record
  2979.             seatprices.price = theatreseats.price
  2980.          next
  2981.       next
  2982.  
  2983.       The above example selects one example only of each seat price
  2984.       in an existing "theatreseats" form in descending price order
  2985.       and enters a new record in the new "seatprices" form.
  2986.  
  2987.  
  2988.  
  2989.  
  2990.  
  2991.  
  2992.                                 - 49 -
  2993. ................................................................................
  2994.       FOR..NEXT              PROCEDURE COMMAND              FOR..NEXT
  2995.  
  2996.       If a "For" loop is qualified by a "Fieldname = " condition then
  2997.       only the record or records where the field contents match the
  2998.       condition will be selected.
  2999.  
  3000.       Ex.
  3001.  
  3002.       for books with category = "fiction"
  3003.          print list items
  3004.       next
  3005.  
  3006.       This example prints all books which have the category "fiction"
  3007.  
  3008.       Ex.
  3009.  
  3010.       For customers with acno = input.acno
  3011.          creditlimit = input.creditlimit
  3012.          update record
  3013.       next
  3014.  
  3015.       In this example the procedure has an input screen where the
  3016.       operator enters a customers account number and new credit
  3017.       limit. On pressing F2 the procedure finds the single record in
  3018.       the "Customers" form which has the input account number and
  3019.       updates the "creditlimit" field.
  3020.  
  3021.  
  3022.  
  3023.  
  3024.  
  3025.  
  3026.  
  3027.  
  3028.  
  3029.  
  3030.  
  3031.  
  3032.  
  3033.  
  3034.  
  3035.  
  3036.  
  3037.  
  3038.  
  3039.  
  3040.  
  3041.  
  3042.  
  3043.  
  3044.  
  3045.  
  3046.  
  3047.  
  3048.  
  3049.                                 - 50 -
  3050. ................................................................................
  3051.       FOR..NEXT              PROCEDURE COMMAND              FOR..NEXT
  3052.  
  3053.       If a "For" loop is qualified by a "with (fieldname) > " or
  3054.       "with (fieldname) >= " condition then records are selected in
  3055.       order like the "with (fieldname) in order" qualification but
  3056.       starting with the first record where the field contents match
  3057.       the condition value rather than the first record.
  3058.  
  3059.       Similarly the qualifications "with (fieldname) < " and "with
  3060.       (fieldname) <= " select records in reverse order but starting
  3061.       with the last record to match the condition value.
  3062.  
  3063.       In case you are new to progamming it should be pointed out that
  3064.       the relational operators >, <, >= and <= can be applied to text
  3065.       as well as to numbers. When they are applied to text they
  3066.       relate to the text's alphabetical order.
  3067.  
  3068.       These four qualifications provide the means to select any
  3069.       subset of records which has a range of values in a particular
  3070.       field.
  3071.  
  3072.       Ex.
  3073.  
  3074.       for pupils with age > 6
  3075.          if pupils.age = 12 then exit for
  3076.          print list items
  3077.       next
  3078.  
  3079.       This example prints the names of all pupils between the ages of
  3080.       seven and eleven. The "For" qualification starts selection in
  3081.       numeric order of age starting at seven and the "Exit for"
  3082.       command terminates the loop when the first pupil aged twelve is
  3083.       loaded.
  3084.  
  3085.       Ex.
  3086.  
  3087.       A "Videos" form has a compound index field called "catorder"
  3088.       which is derived by joining the text of the "category" and
  3089.       "title" fields. The following procedure selects all the videos
  3090.       which have the category entered on the input screen and lists
  3091.       them with the title in alphabetic order.
  3092.  
  3093.       for videos with catorder >= input.category
  3094.          if videos.category > input.category then exit for
  3095.          print list items
  3096.       next
  3097.  
  3098.       Ex.
  3099.  
  3100.       for vehicles with seats > 4 unique
  3101.          count = count + 1
  3102.       next
  3103.  
  3104.       "count" returns the number of different seat capacities > 4
  3105.  
  3106.                                 - 51 -
  3107. ................................................................................
  3108.       FOR..NEXT              PROCEDURE COMMAND              FOR..NEXT
  3109.  
  3110.       If a "For" loop is qualified by "new record" then no records
  3111.       are selected from the form. Instead, a new blank record is
  3112.       created at the "For" command, all statements between the "For"
  3113.       and "Next" commands apply to this new record and it is entered
  3114.       to the form at the "Next" command.
  3115.  
  3116.       Ex.
  3117.  
  3118.       for books new record
  3119.          books.dateinstock = system date
  3120.          copy all from input
  3121.       next
  3122.  
  3123.       This example enters a new record to the "Books" form making the
  3124.       "dateinstock" field equal the system date and copying all other
  3125.       fields from the procedures input screen.
  3126.  
  3127.       Ex.
  3128.  
  3129.       declare variables
  3130.         hourcount as number
  3131.       end
  3132.       '..............clear last wages
  3133.       clear records from wagelist
  3134.       '..........count employees hours from timesheet...
  3135.       for employees
  3136.          hourcount = 0
  3137.          for timesheet with worksno = employees.worksno
  3138.             hourcount = hourcount + timesheet.hours
  3139.          next
  3140.          for wagelist new record
  3141.             wagelist.worksno = employees.worksno
  3142.             wagelist.name = employees.name
  3143.             wagelist.hours = hourcount
  3144.             wagelist.grosswage = employees.wagerate * hourcount
  3145.          next
  3146.       next
  3147.       '.................print the wages list
  3148.       for wagelist with worksno in order
  3149.          print list items
  3150.       next
  3151.  
  3152.       This procedure starts by erasing the present contents of the
  3153.       "wagelist" form. It then selects each record from the
  3154.       "employees" form, counts all entries in the "timesheet" form
  3155.       for the employee and enters a new record in the "wagelist"
  3156.       form. Finally it prints the new wage list.
  3157.  
  3158.  
  3159.  
  3160.  
  3161.  
  3162.  
  3163.                                 - 52 -
  3164. ................................................................................
  3165.       FOR..NEXT              PROCEDURE COMMAND              FOR..NEXT
  3166.  
  3167.       Occasionally you may need to nest a "For" loop of a form within
  3168.       another "For" loop of the same form. If you do this, then in
  3169.       order to differentiate between the fields in the outer and
  3170.       inner loops you must allocate an "alias" name to the form in
  3171.       one of the loops. When you allocate an alias to a form name
  3172.       then all the fields of the form can also be referenced by the
  3173.       alias name.
  3174.  
  3175.       Ex.
  3176.       .......................procedure code...........
  3177.       declare output fields
  3178.          males : females : pupils.age
  3179.       end
  3180.       for pupils with age in order unique
  3181.          males = 0 : females = 0
  3182.          for pupils alias agegroups with age = pupils.age
  3183.             if agegroups.sex = "male" then
  3184.                males = males + 1
  3185.             else
  3186.                females = females + 1
  3187.             end if
  3188.          next
  3189.          print list items
  3190.       next
  3191.       ....................output format......................
  3192.       .list items
  3193.       There are {males} males and {females} females aged {pupils.age}
  3194.       .end
  3195.  
  3196.  
  3197.       This example counts and prints the number of male and female
  3198.       pupils in each age group.
  3199.  
  3200.  
  3201.  
  3202.  
  3203.  
  3204.  
  3205.  
  3206.  
  3207.  
  3208.  
  3209.  
  3210.  
  3211.  
  3212.  
  3213.  
  3214.  
  3215.  
  3216.  
  3217.  
  3218.  
  3219.  
  3220.                                 - 53 -
  3221. ................................................................................
  3222.       FORMATTED TEXT            FIELD TYPE             FORMATTED TEXT
  3223.  
  3224.       If you define a field with the type "formatted text" a window
  3225.       opens up in which you enter the formatting characters. The
  3226.       characters which are to be entered by the user are shown as
  3227.       question marks. Any other characters which you enter become
  3228.       permanent fixtures in the field. The "formatted text" field can
  3229.       be up to twenty characters long and can be used for dates,
  3230.       national insurance numbers etc.
  3231.  
  3232.       Formatted text fields should not be derived.
  3233.  
  3234.  
  3235.  
  3236.  
  3237.  
  3238.  
  3239.  
  3240.  
  3241.  
  3242.  
  3243.  
  3244.  
  3245.  
  3246.  
  3247.  
  3248.  
  3249.  
  3250.  
  3251.  
  3252.  
  3253.  
  3254.  
  3255.  
  3256.  
  3257.  
  3258.  
  3259.  
  3260.  
  3261.  
  3262.  
  3263.  
  3264.  
  3265.  
  3266.  
  3267.  
  3268.  
  3269.  
  3270.  
  3271.  
  3272.  
  3273.  
  3274.  
  3275.  
  3276.  
  3277.                                 - 54 -
  3278. ................................................................................
  3279.       Fun_Key                  SYSTEM VALUE                   Fun_Key
  3280.  
  3281.       The Fun_Key system value holds the number of the function key
  3282.       which was pressed to run a procedure from its input screen. If
  3283.       the procedure was started automatically by a [Run] field
  3284.       control then Fun_Key returns the value 0.
  3285.  
  3286.       The main use of the Fun_Key value is to branch from one
  3287.       procedure to another using the Run command. Its value is also
  3288.       available immediately to the input screen field derivations.
  3289.       You can therefore make any field entry mandatory or not
  3290.       depending on which function key was pressed.
  3291.  
  3292.       Example.
  3293.  
  3294.       If you set the Mandatory entry attribute of field "Name" to
  3295.       "If" and enter the condition "Fun_Key = 2 or Fun_Key 4" then
  3296.       the procedure cannot be run with the F2 or F4 keys unless the
  3297.       Name field has been filed but it can be run with the name field
  3298.       blank if any of the other function keys were pressed.
  3299.  
  3300.       The value of disabled function keys is also available to input
  3301.       screen derivations. You can use disabled function keys to
  3302.       redirect the cursor:
  3303.  
  3304.       if(Fun_Key = 7,fieldname[cursor size],fieldname)
  3305.  
  3306.       By using disabled function keys to redirect the cursor to
  3307.       fields on a different page you can make a single procedure
  3308.       appear to have more than on input screen for different
  3309.       purposes.
  3310.  
  3311.  
  3312.  
  3313.       See also "Run" "Disable"
  3314.  
  3315.  
  3316.  
  3317.  
  3318.  
  3319.  
  3320.  
  3321.  
  3322.  
  3323.  
  3324.  
  3325.  
  3326.  
  3327.  
  3328.  
  3329.  
  3330.  
  3331.  
  3332.  
  3333.  
  3334.                                 - 55 -
  3335. ................................................................................
  3336.       GLOBAL NUMBER            SYSTEM VALUE             GLOBAL NUMBER
  3337.  
  3338.       The variables you create in Easy Base procedures are local
  3339.       variables - they cease to exist when the procedure ends. So
  3340.       that you can pass messages between procedures Easy base
  3341.       provides a single global variable "Global Number".  Once you
  3342.       allocate a value to "Global Number" that value remains
  3343.       unchanged (even if your computer has been turned off) until you
  3344.       allocate another value to it. You can of course pass many
  3345.       messages between procedures simply by entering records in forms
  3346.       and re-reading them but using "Global Number" is much quicker.
  3347.  
  3348.       The following example uses "Global Number" to make access to a
  3349.       user menu restricted by password.
  3350.  
  3351.       Two procedures are defined. The first, "getpassword" has a
  3352.       password field on its input screen and the following code:-
  3353.  
  3354.       if input.password = "gingerbread" then
  3355.          global number = 1
  3356.       else
  3357.          global number = 0
  3358.       end if
  3359.  
  3360.       The second procedure "checkpassword" has the following code:-
  3361.  
  3362.       if global number <> 1 then exit batch menu
  3363.       global number = 0
  3364.  
  3365.       The open access menu system has an item for the restricted menu
  3366.       but instead of calling it direct it calls the menu "Password"
  3367.       which is a batch execute menu with the items
  3368.  
  3369.       run procedure ----  getpassword
  3370.       run procedure ----  checkpassword
  3371.       user menu     ----  restricted
  3372.  
  3373.       If the password "gingerbread" has not been entered in the
  3374.       "getpassword" input screen then "checkpassword" will return
  3375.       control to the original menu.
  3376.  
  3377.  
  3378.  
  3379.  
  3380.  
  3381.  
  3382.  
  3383.  
  3384.  
  3385.  
  3386.  
  3387.  
  3388.  
  3389.  
  3390.  
  3391.                                 - 56 -
  3392. ................................................................................
  3393.       GOTO (FIELD) NEXT      DERIVATION PREFIX      GOTO (FIELD) NEXT
  3394.  
  3395.       In an Easy Base form or procedure input screen the cursor moves
  3396.       from field to field in the default order top left to bottom
  3397.       right when you press the Return key. You can alter this default
  3398.       order by deriving any field with "Goto (fieldname) next". If
  3399.       the field from which you wish to redirect the cursor already
  3400.       has a derivation formula you simply add the "Goto - Next" as a
  3401.       prefix.
  3402.  
  3403.       Ex.
  3404.  
  3405.       goto price next
  3406.  
  3407.       goto item next default(lookup(stock,name))
  3408.  
  3409.       Cursor redirection with the "Goto - next" derivation only
  3410.       occurs when the Return key is pressed it is not activated if
  3411.       you move the cursor with the directional arrow keys.
  3412.  
  3413.       1. You can have more than one prefix on any one field
  3414.          derivation provided there is a space between each.
  3415.  
  3416.  
  3417.  
  3418.  
  3419.  
  3420.  
  3421.  
  3422.  
  3423.  
  3424.  
  3425.  
  3426.  
  3427.  
  3428.  
  3429.  
  3430.  
  3431.  
  3432.  
  3433.  
  3434.  
  3435.  
  3436.  
  3437.  
  3438.  
  3439.  
  3440.  
  3441.  
  3442.  
  3443.  
  3444.  
  3445.  
  3446.  
  3447.  
  3448.                                 - 57 -
  3449. ................................................................................
  3450.       Help                   DERIVATION PREFIX                   Help
  3451.  
  3452.       Easy Base provides a default help line for all data entry and
  3453.       procedure input screens. You can replace the system default
  3454.       help line with your own default help line by pressing F6 during
  3455.       form or screen design.
  3456.  
  3457.       You can also override the default with a field specific help
  3458.       line by using the derivation prefix "Help" followed by the help
  3459.       line in quotation marks.
  3460.  
  3461.       Field specific help lines replace the default help line
  3462.       whenever the cursor is in the field with the derivation prefix.
  3463.  
  3464.       Example: If, in the derivation formula for field "Name" you
  3465.       type:-
  3466.  
  3467.       Help "Enter Customers name and press return"
  3468.  
  3469.       then the help line will show the quoted text whenever the
  3470.       cursor is in the Name field but will revert to the default when
  3471.       the cursor moves to another field.
  3472.  
  3473.       You can use the Help prefix in any or all fields.
  3474.  
  3475.       The help line has a maximum length of 80 characters. If you
  3476.       quote a help line greater than 80 characters it will be
  3477.       truncated at run time. Help lines of less than 80 characters
  3478.       are automatically padded to 80 with space characters.
  3479.  
  3480.       If the field already has a derivation formula, add the help as
  3481.       a prefix:-
  3482.  
  3483.       Help "Enter Part Name" proper(partname)
  3484.  
  3485.       Notes:
  3486.  
  3487.       1.  There must be a space between Help and the quoted line.
  3488.  
  3489.       2.  The line must be in quotes and quotation marks cannot be
  3490.           included in the line.
  3491.  
  3492.       3.  You can have more than one prefix on any one field
  3493.           derivation provided there is a space between each.
  3494.  
  3495.       Ex.
  3496.  
  3497.       Autodial Help "Press Ctrl + D to Dial" lookup(customers,No)
  3498.  
  3499.  
  3500.  
  3501.  
  3502.  
  3503.  
  3504.  
  3505.                                 - 58 -
  3506. ................................................................................
  3507.       HOURS                      FUNCTION                       HOURS
  3508.  
  3509.       This function returns the hour ( 1 to 23) of the time parameter
  3510.  
  3511.       Ex.  Hour(system time)
  3512.  
  3513.       Ex.
  3514.  
  3515.       Labourcharge = (hours(endtime)-hours(starttime))* rate
  3516.  
  3517.  
  3518.       Acceptable parameters:
  3519.  
  3520.       System time
  3521.       Time field
  3522.       Maketime function
  3523.       Time expression
  3524.  
  3525.  
  3526.  
  3527.  
  3528.  
  3529.  
  3530.  
  3531.  
  3532.  
  3533.  
  3534.  
  3535.  
  3536.  
  3537.  
  3538.  
  3539.  
  3540.  
  3541.  
  3542.  
  3543.  
  3544.  
  3545.  
  3546.  
  3547.  
  3548.  
  3549.  
  3550.  
  3551.  
  3552.  
  3553.  
  3554.  
  3555.  
  3556.  
  3557.  
  3558.  
  3559.  
  3560.  
  3561.  
  3562.                                 - 59 -
  3563. ................................................................................
  3564.       IF                         FUNCTION                          IF
  3565.  
  3566.       Ex.  if(num >= 0,"Positive","negative")
  3567.  
  3568.       The first parameter of the "if" function is an expression, the
  3569.       second is the value to be returned if the expression is true
  3570.       and the third is the value to be returned if the expression is
  3571.       false.
  3572.  
  3573.       If the third parameter is omitted and the expression is false
  3574.       then the field or variable retains any value it had before the
  3575.       function was called.
  3576.  
  3577.       The "if" function can be extended to a full "case" function
  3578.       simply by adding more expressions and return values.
  3579.  
  3580.       Ex.  if(num > 0,"Positive",num = 0,"Zero","Negative")
  3581.  
  3582.       There is no limit to the number of expressions and return
  3583.       values. If more than one expression is true the value returned
  3584.       is that for the first true expression. If none are true then
  3585.       the trailing value is returned as the "case else".
  3586.  
  3587.       Acceptable Parameters:
  3588.  
  3589.       Numeric expressions
  3590.       Quoted text
  3591.       Fields and variables
  3592.       Other nested functions
  3593.       System Values
  3594.  
  3595.  
  3596.  
  3597.  
  3598.  
  3599.  
  3600.  
  3601.  
  3602.  
  3603.  
  3604.  
  3605.  
  3606.  
  3607.  
  3608.  
  3609.  
  3610.  
  3611.  
  3612.  
  3613.  
  3614.  
  3615.  
  3616.  
  3617.  
  3618.  
  3619.                                 - 60 -
  3620. ................................................................................
  3621.       IF THEN ELSE           PROCEDURE COMMAND           IF THEN ELSE
  3622.  
  3623.       Easy Base recognizes the following "If Then Else"
  3624.       constructions.
  3625.  
  3626.       1.    if (condition) then (action)
  3627.             ------------------------------------------
  3628.       2.    if (condition) then (action) else (action)
  3629.             ------------------------------------------
  3630.       3.    if (condition) then
  3631.                (action)
  3632.                (action)
  3633.                (action)
  3634.             end if
  3635.             -----------------------------------------
  3636.       4.    if (condition) then
  3637.                (action)
  3638.                (action)
  3639.             else
  3640.                (action)
  3641.                (action)
  3642.             end if
  3643.  
  3644.       If then constructions can be nested to any depth.
  3645.  
  3646.       if (condition) and (condition) then
  3647.          (action)
  3648.          if (condition) or (condition) then
  3649.             (action)
  3650.             (action)
  3651.          else
  3652.             (action)
  3653.             if (condition) eqv (condition) then (action)
  3654.             (action)
  3655.          end if
  3656.          if (condition) then (action)
  3657.       else
  3658.          (action)
  3659.       end if
  3660.  
  3661.       Easy base does not interpret "Else if" constructions.
  3662.  
  3663.       Easy base does not interpret two "if" conditions on one line.
  3664.  
  3665.  
  3666.       In the above examples "action" applies to any Easy base command
  3667.       or full "Do Loop" or full "For Next" structure.
  3668.  
  3669.       You cannot split a "Do Loop" structure and you can only split a
  3670.       "For Next" structure by a simple "If then" and "End if" with no
  3671.       "else" command.
  3672.  
  3673.       Ex. on next page.
  3674.  
  3675.  
  3676.                                 - 61 -
  3677. ................................................................................
  3678.       IF THEN ELSE           PROCEDURE COMMAND           IF THEN ELSE
  3679.  
  3680.       In the following example the procedure has an input screen with
  3681.       a field "type". "type" is a choice field with the choices "In
  3682.       age order", "In alphabetic order" and "By sex". The procedure
  3683.       code selects one of three listings from the "Pupils" form by
  3684.       splitting "For Next" structures by "If Then" structures.
  3685.  
  3686.       if input.type = "in age order" then
  3687.          for pupils with age in order
  3688.       end if
  3689.       if input.type = "in alphabetic order" then
  3690.          for pupils with name in order
  3691.       end if
  3692.       if input.type = "by sex" then
  3693.          for pupils with sex in order
  3694.       end if
  3695.          print list items
  3696.       next
  3697.       next
  3698.       next
  3699.  
  3700.       The structure above is the only one in which "For Next"
  3701.       structures can be split. There must be a separate "If Then"
  3702.       followed by "End If" for each "For". There must be a "Next for
  3703.       each "For"  and there cannot be an "Else" anywhere in the
  3704.       construction.
  3705.  
  3706.  
  3707.  
  3708.  
  3709.  
  3710.  
  3711.  
  3712.  
  3713.  
  3714.  
  3715.  
  3716.  
  3717.  
  3718.  
  3719.  
  3720.  
  3721.  
  3722.  
  3723.  
  3724.  
  3725.  
  3726.  
  3727.  
  3728.  
  3729.  
  3730.  
  3731.  
  3732.  
  3733.                                 - 62 -
  3734. ................................................................................
  3735.       INDEX OFF              PROCEDURE COMMAND              INDEX OFF
  3736.  
  3737.       When an Easy Base procedure adds, updates or deletes a record
  3738.       then by default it updates any affected index files. As the
  3739.       majority of transaction procedures act on a single record this
  3740.       is the fastest method of processing. It does of course require
  3741.       that the form is periodically re-packed.  If, however, a
  3742.       procedure is to add, update or delete many records then
  3743.       updating each affected index file on each iteration of the
  3744.       "For" loop can be much slower than ignoring the indices during
  3745.       the loop and re-writing them from scratch afterward.
  3746.  
  3747.       You can take the "re-write" option by issuing the command
  3748.       "Index off" before the "For" loop.
  3749.  
  3750.       index off
  3751.       for employees
  3752.         for wagelist new record
  3753.            wagelist.worksno = employees.worksno
  3754.            wagelist.taxcode = employees.taxcode
  3755.         next
  3756.       next
  3757.  
  3758.       Obviously re-writing an entire index file when only one or two
  3759.       records are affected would be slower than simply updating the
  3760.       indices. The actual point at which "Index Off" becomes faster
  3761.       can only be determined by trial but as a general rule the two
  3762.       systems take equal time when between 12 and 15 percent of the
  3763.       records of a file are affected and the advantage of "Index Off"
  3764.       becomes greater the bigger this percentage.
  3765.  
  3766.       There is no corresponding "Index On" command. Indexing is
  3767.       turned back on automatically and the index files are re-written
  3768.       at the end of the loop to which the command applies. If you
  3769.       require indexing off during more than one loop you must issue
  3770.       the command before each.
  3771.  
  3772.       index off
  3773.       for invoices with date < makedate(05,04,93)
  3774.          delete records
  3775.       next
  3776.       index off
  3777.       for invoices with customer = "john smith"
  3778.          invoices.customer = "John Smith Ltd"
  3779.          update record
  3780.       next
  3781.  
  3782.       If you prefix a loop which deletes records from a form then the
  3783.       form is packed at the end of the loop.
  3784.  
  3785.  
  3786.  
  3787.  
  3788.  
  3789.  
  3790.                                 - 63 -
  3791. ................................................................................
  3792.       INSTALL FORM               UTILITY                 INSTALL FORM
  3793.  
  3794.       The "Install Form" utility is accessed from the Utilities menu.
  3795.       If you wish to include a form in one application which you
  3796.       designed in another then you cannot simply copy the files to
  3797.       the new applications directory as there will be no entry in the
  3798.       "Forms Directory" file.
  3799.  
  3800.       To install a form from another application - first get the
  3801.       forms DOS filename from that application then select "Install
  3802.       Form" from the utilities menu. You will be asked to supply the
  3803.       forms name and the full path and filename from where it is to
  3804.       be copied. Easy Base will then copy the forms definition file
  3805.       and make the appropriate entry in the "Forms Directory". It
  3806.       will then ask whether or not you wish the data to be copied
  3807.       from the original application.
  3808.  
  3809.       If you install a form from another application and it has
  3810.       "lookup" derivations or Choice List fields then you will have
  3811.       to create the relationships and choice lists in the new
  3812.       application. They are not automatically reproduced.
  3813.  
  3814.  
  3815.  
  3816.  
  3817.  
  3818.  
  3819.  
  3820.  
  3821.  
  3822.  
  3823.  
  3824.  
  3825.  
  3826.  
  3827.  
  3828.  
  3829.  
  3830.  
  3831.  
  3832.  
  3833.  
  3834.  
  3835.  
  3836.  
  3837.  
  3838.  
  3839.  
  3840.  
  3841.  
  3842.  
  3843.  
  3844.  
  3845.  
  3846.  
  3847.                                 - 64 -
  3848. ................................................................................
  3849.       INSTALL PRINTER            UTILITY              INSTALL PRINTER
  3850.  
  3851.       The "Install printer" utility is accessed from the Utilities
  3852.       menu. It can also be included in a user menu so that end users
  3853.       of finished applications can install their printer without
  3854.       access to the system menus.
  3855.  
  3856.       When you select "Install Printer" you are offered a choice of
  3857.       ten printer drivers - five for named printers and five generic
  3858.       drivers. The drivers supplied cover virtually all printers
  3859.       except daisy wheels.
  3860.  
  3861.       When you have chosen your printer driver Easy Base then asks
  3862.       for the parallel port number to which printer output is to be
  3863.       sent - one or two. Easy Base does not have a built in serial
  3864.       port printer output. If your printer only has a serial input
  3865.       then you must redirect a parallel port with the DOS "Mode"
  3866.       command.
  3867.  
  3868.       Easy Base then asks how much paper wastage there is at the top
  3869.       of the page. This is quite important as it is used in
  3870.       conjunction with the paper size in use to determine the
  3871.       "Bottom Margin" value, used for pagination in printed reports.
  3872.  
  3873.       You are then asked for the wastage at the left margin. This
  3874.       information is used in the format editor to display the right
  3875.       edge of the paper at the different print sizes. There are only
  3876.       two settings for wastage at the left margin - zero and ¼ inch.
  3877.       If you have a cartridge fed printer such as a Laser or Bubble
  3878.       Jet then it will almost certainly be ¼ inch. If you have a
  3879.       traction or manual feed then you will be able to adjust the
  3880.       left margin and you should set it to zero.
  3881.  
  3882.       Finally you are asked for the top margin required in printed
  3883.       reports. This can only be between the value set as the printers
  3884.       inherent wastage and one inch.  The value you set here will be
  3885.       the default top margin for all printouts. If you need a larger
  3886.       top margin for certain printouts then you must include blank
  3887.       lines in the page header of the procedures output format.
  3888.  
  3889.  
  3890.  
  3891.  
  3892.  
  3893.  
  3894.  
  3895.  
  3896.  
  3897.  
  3898.  
  3899.  
  3900.  
  3901.  
  3902.  
  3903.  
  3904.                                 - 65 -
  3905. ................................................................................
  3906.       INSTALL PROCEDURE          UTILITY            INSTALL PROCEDURE
  3907.  
  3908.       The "Install procedure" utility is accessed from the
  3909.       Utilities menu and allows you to install procedures which you
  3910.       designed in another application. It is used exactly like the
  3911.       "Install Form" utility previously described.
  3912.  
  3913.  
  3914.  
  3915.  
  3916.  
  3917.  
  3918.  
  3919.  
  3920.  
  3921.  
  3922.  
  3923.  
  3924.  
  3925.  
  3926.  
  3927.  
  3928.  
  3929.  
  3930.  
  3931.  
  3932.  
  3933.  
  3934.  
  3935.  
  3936.  
  3937.  
  3938.  
  3939.  
  3940.  
  3941.  
  3942.  
  3943.  
  3944.  
  3945.  
  3946.  
  3947.  
  3948.  
  3949.  
  3950.  
  3951.  
  3952.  
  3953.  
  3954.  
  3955.  
  3956.  
  3957.  
  3958.  
  3959.  
  3960.  
  3961.                                 - 66 -
  3962. ................................................................................
  3963.       INTEGER                   FIELD TYPE                    INTEGER
  3964.  
  3965.       Integer fields can have up to 14 digits and use a comma as the
  3966.       thousands separator.
  3967.  
  3968.       Although integer fields display integers they store the result
  3969.       of any division correct to 15 significant figures.
  3970.  
  3971.       See - Operators Arithmetic
  3972.  
  3973.  
  3974.  
  3975.  
  3976.  
  3977.  
  3978.  
  3979.  
  3980.  
  3981.  
  3982.  
  3983.  
  3984.  
  3985.  
  3986.  
  3987.  
  3988.  
  3989.  
  3990.  
  3991.  
  3992.  
  3993.  
  3994.  
  3995.  
  3996.  
  3997.  
  3998.  
  3999.  
  4000.  
  4001.  
  4002.  
  4003.  
  4004.  
  4005.  
  4006.  
  4007.  
  4008.  
  4009.  
  4010.  
  4011.  
  4012.  
  4013.  
  4014.  
  4015.  
  4016.  
  4017.  
  4018.                                 - 67 -
  4019. ................................................................................
  4020.       INTEXT                     FUNCTION                      INTEXT
  4021.  
  4022.       This function returns the starting character number of one
  4023.       length of text within another.
  4024.  
  4025.       Ex.    Intext(companyname," and ")
  4026.              < Returns 7 if companyname = "Turner and Smith"
  4027.  
  4028.       The intext function returns 0 if the second parameter is not
  4029.       found in the first.
  4030.  
  4031.       Ex.
  4032.  
  4033.       If intext(customers.companyname," Ltd") <> 0 then
  4034.          customers.Ltd  = "yes"
  4035.          update record
  4036.       end if
  4037.  
  4038.       Acceptable parameters:
  4039.  
  4040.       Text field/variable
  4041.       Any function returning a text value
  4042.  
  4043.  
  4044.  
  4045.  
  4046.  
  4047.  
  4048.  
  4049.  
  4050.  
  4051.  
  4052.  
  4053.  
  4054.  
  4055.  
  4056.  
  4057.  
  4058.  
  4059.  
  4060.  
  4061.  
  4062.  
  4063.  
  4064.  
  4065.  
  4066.  
  4067.  
  4068.  
  4069.  
  4070.  
  4071.  
  4072.  
  4073.  
  4074.  
  4075.                                 - 68 -
  4076. ................................................................................
  4077.       JOINTEXT                   FUNCTION                    JOINTEXT
  4078.  
  4079.       Ex.  Jointext(forename,surname)
  4080.  
  4081.       The jointext function takes any number of parameters.
  4082.  
  4083.       Ex.  Jointext("Mr ",forename," ",surname," Esq.")
  4084.       Ex.  Jointext(if(sex=male,"Mr ","Ms "),surname)
  4085.  
  4086.       The "jointext" function will also perform any arithmetic
  4087.       operations required for a text output.
  4088.  
  4089.       Ex. Jointext("The Gross price is ",netprice *120/100)
  4090.  
  4091.       The "jointext" function is also used for creating compound
  4092.       index fields.
  4093.  
  4094.       Ex. Jointext(reverse(zeropad(price,4,2)),stockitem)
  4095.  
  4096.       This creates a field whose index allows a stock file to be
  4097.       listed with stockitem in alphabetical order but grouped by
  4098.       price in reverse order.
  4099.  
  4100.       If you "Jointext" a date or time field you will get the date or
  4101.       time's numeric value not the date or time's string
  4102.       representation. (See Compound Index)
  4103.  
  4104.       By default the "Jointext" function strips trailing blank space
  4105.       characters from the texts being joined. If you wish to join
  4106.       text in a Text Block field so that the second text starts on a
  4107.       new line then you can force this by including Chr$(13) which
  4108.       Easy base uses as a "New Line" flag.
  4109.  
  4110.       Ex.
  4111.  
  4112.           Jointext(block1,chr$(13),block2)
  4113.  
  4114.           <The text from block2 will start on a new line>
  4115.  
  4116.       Ex.
  4117.  
  4118.           Jointext(block1,chr$(13),chr$(13),block2)
  4119.  
  4120.          <There will be a blank line between block1 and block2>
  4121.  
  4122.       Acceptable Parameters:
  4123.  
  4124.       Numeric expressions
  4125.       Quoted text
  4126.       Fields and variables
  4127.       Other nested functions
  4128.       System Values
  4129.  
  4130.  
  4131.  
  4132.                                 - 69 -
  4133. ................................................................................
  4134.       LEFTTEXT                   FUNCTION                    LEFTTEXT
  4135.  
  4136.       This function returns a specified number of characters from the
  4137.       start of a field or variable.
  4138.  
  4139.       Ex.   Lefttext(salutation,2)
  4140.             < returns "Mr" from "Mr Smith" or "Ms" from "Ms Smith"
  4141.  
  4142.       Ex.   Lefttext(datetext(system date),4)
  4143.             < Returns 12th , 20th Etc.>   (European date format)
  4144.  
  4145.  
  4146.  
  4147.  
  4148.       Acceptable parameters:
  4149.  
  4150.       Text field/variable
  4151.       Any function returning a text value
  4152.  
  4153.  
  4154.  
  4155.  
  4156.  
  4157.  
  4158.  
  4159.  
  4160.  
  4161.  
  4162.  
  4163.  
  4164.  
  4165.  
  4166.  
  4167.  
  4168.  
  4169.  
  4170.  
  4171.  
  4172.  
  4173.  
  4174.  
  4175.  
  4176.  
  4177.  
  4178.  
  4179.  
  4180.  
  4181.  
  4182.  
  4183.  
  4184.  
  4185.  
  4186.  
  4187.  
  4188.  
  4189.                                 - 70 -
  4190. ................................................................................
  4191.       LENGTHTEXT                 FUNCTION                  LENGTHTEXT
  4192.  
  4193.       This function returns the length of text in a field or variable
  4194.  
  4195.       Ex.   lengthtext(name)
  4196.             < Returns 4 if name = "Bill"  10 if name = "Bill Smith"
  4197.  
  4198.  
  4199.       Acceptable parameters:
  4200.  
  4201.       Text field/variable
  4202.       Any function returning a text value
  4203.  
  4204.  
  4205.  
  4206.  
  4207.  
  4208.  
  4209.  
  4210.  
  4211.  
  4212.  
  4213.  
  4214.  
  4215.  
  4216.  
  4217.  
  4218.  
  4219.  
  4220.  
  4221.  
  4222.  
  4223.  
  4224.  
  4225.  
  4226.  
  4227.  
  4228.  
  4229.  
  4230.  
  4231.  
  4232.  
  4233.  
  4234.  
  4235.  
  4236.  
  4237.  
  4238.  
  4239.  
  4240.  
  4241.  
  4242.  
  4243.  
  4244.  
  4245.  
  4246.                                 - 71 -
  4247. ................................................................................
  4248.       LIST FILE NAMES            UTILITY              LIST FILE NAMES
  4249.  
  4250.       When you give a name to a Form or Procedure in Easy Base it is
  4251.       not the actual DOS file name used. A Form has separate DOS
  4252.       files for its definition, its data and its indices. Similarly a
  4253.       procedure can have one or two files depending on whether or not
  4254.       it has an input screen. Within an application you never need to
  4255.       know the DOS filenames as Easy Base takes care of all disk
  4256.       activity in the background.
  4257.  
  4258.       You may however need to know the DOS filenames if you intend to
  4259.       export data to another program or copy a Form or Procedure from
  4260.       one application to another.
  4261.  
  4262.       You can list the DOS filenames for Forms and reports with the
  4263.       "List File Names" utility.
  4264.  
  4265.       The "List File Names" utility can also be called from a user
  4266.       menu without accessing the system.
  4267.  
  4268.  
  4269.  
  4270.  
  4271.  
  4272.  
  4273.  
  4274.  
  4275.  
  4276.  
  4277.  
  4278.  
  4279.  
  4280.  
  4281.  
  4282.  
  4283.  
  4284.  
  4285.  
  4286.  
  4287.  
  4288.  
  4289.  
  4290.  
  4291.  
  4292.  
  4293.  
  4294.  
  4295.  
  4296.  
  4297.  
  4298.  
  4299.  
  4300.  
  4301.  
  4302.  
  4303.                                 - 72 -
  4304. ................................................................................
  4305.       LIST VARIABLES         PROCEDURE COMMAND         LIST VARIABLES
  4306.  
  4307.       The "List Variables" command is a de-bugging facility for
  4308.       developers. If a procedure is not producing the expected
  4309.       results you can interrupt it at any point and view the contents
  4310.       of all fields and variables in memory at that point.
  4311.  
  4312.       Ex.
  4313.  
  4314.       for authors with surname in order
  4315.          if authors.surname = "kippling" then list variables
  4316.          for books with author = authors.surname
  4317.             print list items
  4318.          next
  4319.       next
  4320.  
  4321.  
  4322.  
  4323.  
  4324.  
  4325.  
  4326.  
  4327.  
  4328.  
  4329.  
  4330.  
  4331.  
  4332.  
  4333.  
  4334.  
  4335.  
  4336.  
  4337.  
  4338.  
  4339.  
  4340.  
  4341.  
  4342.  
  4343.  
  4344.  
  4345.  
  4346.  
  4347.  
  4348.  
  4349.  
  4350.  
  4351.  
  4352.  
  4353.  
  4354.  
  4355.  
  4356.  
  4357.  
  4358.  
  4359.  
  4360.                                 - 73 -
  4361. ................................................................................
  4362.       Lock / Unlock          Procedure Command          Lock / Unlock
  4363.  
  4364.       Network versions only
  4365.  
  4366.       Easy Base automatically places protective locks whenever any
  4367.       process might cause a multiple access confliction. You do not
  4368.       have to use the Lock and Unlock commands to avoid such
  4369.       conflicts.
  4370.  
  4371.       There will however be occasions where multiple access would
  4372.       prevent the correct execution of an application even though no
  4373.       access conflict would occur.
  4374.  
  4375.       For Example, if a procedure collects statistics from form a and
  4376.       form b then updates form c with the information, you might not
  4377.       wish to have any other workstation access form c until the
  4378.       update is complete. Easy Base would not automatically prevent
  4379.       access to form c while your procedure read from a and b as this
  4380.       would not cause any access conflicts.
  4381.  
  4382.       To prevent access in such cases use the Lock and Unlock
  4383.       Commands.
  4384.  
  4385.       Declare variables
  4386.          Count as number
  4387.       end
  4388.       Lock Stats : Lock Stock
  4389.       for Stock with Location = input.location
  4390.          delete record
  4391.       next
  4392.       Pack Stock
  4393.       Unlock Stock
  4394.       For stock
  4395.          count = stock.total records
  4396.          exit for
  4397.       next
  4398.       for stats
  4399.          stats.stockitems = count
  4400.          update record
  4401.       next
  4402.       Unlock stats
  4403.  
  4404.       Locks placed with the Lock command are total locks. There is no
  4405.       option to place read only locking. Once a lock command has been
  4406.       executed it remains in force until the same workstation issues
  4407.       an unlock command for the form. If you need a form to remain
  4408.       locked between procedures you can issue the Lock command in one
  4409.       procedure and the Unlock command in another. In such cases you
  4410.       need to ensure that there is no way to avoid running the
  4411.       procedure with the Unlock command.
  4412.  
  4413.       Similarly, when the Lock and Unlock commands are within a
  4414.       single procedure, there must not be any option to exit the
  4415.       procedure between the two commands.
  4416.  
  4417.                                 - 74 -
  4418. ................................................................................
  4419.       LOOKUP                     FUNCTION                      LOOKUP
  4420.  
  4421.       Ex. Lookup(customers,surname)
  4422.           Lookup(customers,surname,address)
  4423.  
  4424.       The first parameter is the name of a relationship defined in
  4425.       the relationships form. The second parameter is the name of the
  4426.       field in the secondary file whose value is to be looked up. The
  4427.       third parameter, which is optional, specifies that a field
  4428.       other than the looked up field is to be listed for selection
  4429.       when there is more than one match. (The looked up field must be
  4430.       indexed)
  4431.  
  4432.       The parameters are absolute. You cannot supply them as
  4433.       variables, fields or the results of other functions.
  4434.  
  4435.       In the first example, if you enter "Sm*" in the field with the
  4436.       derivation and there are several names beginning with Sm, then
  4437.       the names will be listed for you to choose from. This is most
  4438.       useful if all the names are different. If, however, there are
  4439.       several names beginning with Sm but they are all "Smith" then
  4440.       it will be more useful to use the second example which will
  4441.       list all the addresses for the "Smith" names.
  4442.  
  4443.       Lookup functions which have two parameters do not list
  4444.       duplicates when there is more than one match, whereas lookup
  4445.       functions with three parameters do. You can therefore use one
  4446.       lookup of the first type and one lookup of the second type to
  4447.       resolve ambiguities.
  4448.  
  4449.       For example, to perform lookups from the customers form (which
  4450.       has duplicates in the "Surname" field), you would firstly
  4451.       create an additional invisible field on the input screen
  4452.       (surname2) derived surname. You then enter two relationships
  4453.       between the screen and the customers form. The first, called
  4454.       customers, links surname with surname and the second, called
  4455.       customers2, links surname2 with surname.
  4456.  
  4457.       The surname field on the input screen is derived -
  4458.       Lookup(customers,surname). All the other fields to be looked up
  4459.       are derived - Lookup(customers2,fieldname) but one of them (Any
  4460.       one) has the third parameter added :-
  4461.  
  4462.       Lookup(customers2,forename,address)
  4463.  
  4464.       When you enter "Sm" in the surname field, the first lookup will
  4465.       list all the customer surnames beginning with "Sm". When you
  4466.       choose "Smith" from this list, "Smith" will be copied to the
  4467.       invisible field Surname2 and the second lookup will trigger
  4468.       listing all the addresses of the Smith customers.
  4469.  
  4470.  
  4471.  
  4472.  
  4473.  
  4474.                                 - 75 -
  4475. ................................................................................
  4476.       LOWER                      FUNCTION                       LOWER
  4477.  
  4478.       Returns the lower case of the parameter.
  4479.  
  4480.       Ex. lower(partname)
  4481.  
  4482.  
  4483.       Ex.
  4484.  
  4485.       Heading = Jointext("List of parts supplied by ",lower(makers.
  4486.       name))
  4487.  
  4488.  
  4489.       Acceptable parameters:
  4490.  
  4491.       Quoted text
  4492.       Text Field/variable
  4493.  
  4494.  
  4495.  
  4496.  
  4497.  
  4498.  
  4499.  
  4500.  
  4501.  
  4502.  
  4503.  
  4504.  
  4505.  
  4506.  
  4507.  
  4508.  
  4509.  
  4510.  
  4511.  
  4512.  
  4513.  
  4514.  
  4515.  
  4516.  
  4517.  
  4518.  
  4519.  
  4520.  
  4521.  
  4522.  
  4523.  
  4524.  
  4525.  
  4526.  
  4527.  
  4528.  
  4529.  
  4530.  
  4531.                                 - 76 -
  4532. ................................................................................
  4533.       MAKEDATE                   FUNCTION                    MAKEDATE
  4534.  
  4535.       The Easy base Date field is a six digit field which covers the
  4536.       century from 1 Jan 1981 to 31 Dec 2080 and upon which you can
  4537.       perform addition and subtraction operations in days.
  4538.  
  4539.       Ex. Duedate = Invoicedate + 30
  4540.  
  4541.       In order to provide this facility the date is held as a numeric
  4542.       value. You can only type a date directly into a date field.
  4543.  
  4544.       If you need to enter a date in a derivation or in a procedure
  4545.       code you must use the "makedate" function.
  4546.  
  4547.       Ex.  Makedate(5,11,95)
  4548.           < Returns 05/11/95 >
  4549.  
  4550.       Ex.  Nextmonth = month(system date)+1
  4551.            if nextmonth = 13 then nextmonth = 1
  4552.            Nextdelivery = makedate(1,nextmonth,year(system date))
  4553.            < Returns the date of the first of next month >
  4554.  
  4555.       Acceptable parameters
  4556.  
  4557.       Numeric value
  4558.       Numeric expression
  4559.       Numeric field/variable
  4560.       Any other function which returns a numeric value
  4561.  
  4562.  
  4563.  
  4564.  
  4565.  
  4566.  
  4567.  
  4568.  
  4569.  
  4570.  
  4571.  
  4572.  
  4573.  
  4574.  
  4575.  
  4576.  
  4577.  
  4578.  
  4579.  
  4580.  
  4581.  
  4582.  
  4583.  
  4584.  
  4585.  
  4586.  
  4587.  
  4588.                                 - 77 -
  4589. ................................................................................
  4590.       MAKETIME                   FUNCTION                    MAKETIME
  4591.  
  4592.       The value of a time field in Easy base is held as a numeric
  4593.       value representing the number of seconds past midnight. This
  4594.       allows you to perform addition and subtraction operations in
  4595.       seconds.
  4596.  
  4597.       Ex. Timetaken = Round(Endtime - Starttime / 60)
  4598.           < This returns the time taken in minutes >
  4599.  
  4600.       You can only enter a time directly into a time field.
  4601.  
  4602.       If you need to enter a time in a field derivation or in a
  4603.       procedure code you must use the "Maketime" function.
  4604.  
  4605.       Ex. Time = Maketime(20,20,00)
  4606.            <  returns 20:20:00  >
  4607.  
  4608.  
  4609.       Acceptable parameters:
  4610.  
  4611.       Numeric value
  4612.       Numeric expression
  4613.       Numeric field/variable
  4614.       Any other function which returns a numeric value
  4615.  
  4616.  
  4617.  
  4618.  
  4619.  
  4620.  
  4621.  
  4622.  
  4623.  
  4624.  
  4625.  
  4626.  
  4627.  
  4628.  
  4629.  
  4630.  
  4631.  
  4632.  
  4633.  
  4634.  
  4635.  
  4636.  
  4637.  
  4638.  
  4639.  
  4640.  
  4641.  
  4642.  
  4643.  
  4644.  
  4645.                                 - 78 -
  4646. ................................................................................
  4647.       Manual Feed            Procedure Command            Manual Feed
  4648.  
  4649.       When you set the paper type in use from the utilities menu, you
  4650.       tell Easy Base whether you have a manual or continuous feed
  4651.       printer. This is then used throughout all procedures.
  4652.  
  4653.       If your printer has a continuous feed but a particular
  4654.       procedure requires manual eg label or envelope printing you can
  4655.       force Easy Base to pause after each page without changing the
  4656.       default by issuing the Manual Feed command within the procedure
  4657.       code.
  4658.  
  4659.       Declare output fields
  4660.          mail.name :mail.address
  4661.       end
  4662.       manual feed
  4663.       for mail
  4664.          print envelope
  4665.       next
  4666.  
  4667.  
  4668.  
  4669.  
  4670.  
  4671.  
  4672.  
  4673.  
  4674.  
  4675.  
  4676.  
  4677.  
  4678.  
  4679.  
  4680.  
  4681.  
  4682.  
  4683.  
  4684.  
  4685.  
  4686.  
  4687.  
  4688.  
  4689.  
  4690.  
  4691.  
  4692.  
  4693.  
  4694.  
  4695.  
  4696.  
  4697.  
  4698.  
  4699.  
  4700.  
  4701.  
  4702.                                 - 79 -
  4703. ................................................................................
  4704.       MATHS                      FUNCTION                       MATHS
  4705.  
  4706.       The following maths functions can be used anywhere in Easy Base
  4707.       code or field derivations.
  4708.  
  4709.       Log()
  4710.       Log10()
  4711.       Sqrt()
  4712.       Sin()
  4713.       Cos()
  4714.       Tan()
  4715.       Atan()
  4716.       Deg_rad()     converts degrees to radians
  4717.       Rad_deg()     converts radians to degrees
  4718.       Exp()         Raises e (the base of natural logarithms) to the
  4719.                     power of the parameter
  4720.  
  4721.  
  4722.       Acceptable parameters:
  4723.  
  4724.       Numeric value
  4725.       Numeric expression
  4726.       Numeric field/variable
  4727.       Any function returning a numeric value
  4728.  
  4729.  
  4730.  
  4731.  
  4732.  
  4733.  
  4734.  
  4735.  
  4736.  
  4737.  
  4738.  
  4739.  
  4740.  
  4741.  
  4742.  
  4743.  
  4744.  
  4745.  
  4746.  
  4747.  
  4748.  
  4749.  
  4750.  
  4751.  
  4752.  
  4753.  
  4754.  
  4755.  
  4756.  
  4757.  
  4758.  
  4759.                                 - 80 -
  4760. ................................................................................
  4761.       MENU CALLS               MENU FUNCTION               MENU CALLS
  4762.  
  4763.       In addition to the utilities which can be called from user
  4764.       menus the following calls can also be made.
  4765.  
  4766.       Run Procedure        :   Runs a pre-defined procedure
  4767.  
  4768.       Last Output          :   Recalls the output from a procedure
  4769.  
  4770.       Data Entry           :   Allows direct access to a form
  4771.  
  4772.       User Menu            :   Calls another user menu
  4773.  
  4774.       System Menus         :   Calls the Easy Base System menus
  4775.  
  4776.       Exit to DOS          :   Terminates Easy Base
  4777.  
  4778.       Run external program : Shells to another program
  4779.  
  4780.       Notes:
  4781.  
  4782.  
  4783.       You cannot run another major program from within Easy Base -
  4784.       there is very little spare memory - this call is however useful
  4785.       for calling batch files which export data to other programs for
  4786.       later use.
  4787.  
  4788.       If you place "Exit to DOS" on a normal menu the user will be
  4789.       asked to confirm that he wishes to exit. If you place it on a
  4790.       batch execute menu he will not.
  4791.  
  4792.  
  4793.  
  4794.  
  4795.  
  4796.  
  4797.  
  4798.  
  4799.  
  4800.  
  4801.  
  4802.  
  4803.  
  4804.  
  4805.  
  4806.  
  4807.  
  4808.  
  4809.  
  4810.  
  4811.  
  4812.  
  4813.  
  4814.  
  4815.  
  4816.                                 - 81 -
  4817. ................................................................................
  4818.       MIDTEXT                    FUNCTION                     MIDTEXT
  4819.  
  4820.       This function returns a given number of characters from a given
  4821.       starting point in a field or variable.
  4822.  
  4823.       Ex.   Midtext(fileref,4,4)
  4824.             < Returns "Bill" from "TR/Bill/1243"
  4825.  
  4826.  
  4827.       Acceptable parameters:
  4828.  
  4829.       Text field/variable
  4830.       Any function returning a text value
  4831.  
  4832.  
  4833.  
  4834.  
  4835.  
  4836.  
  4837.  
  4838.  
  4839.  
  4840.  
  4841.  
  4842.  
  4843.  
  4844.  
  4845.  
  4846.  
  4847.  
  4848.  
  4849.  
  4850.  
  4851.  
  4852.  
  4853.  
  4854.  
  4855.  
  4856.  
  4857.  
  4858.  
  4859.  
  4860.  
  4861.  
  4862.  
  4863.  
  4864.  
  4865.  
  4866.  
  4867.  
  4868.  
  4869.  
  4870.  
  4871.  
  4872.  
  4873.                                 - 82 -
  4874. ................................................................................
  4875.       MINUTES                    FUNCTION                     MINUTES
  4876.  
  4877.       This function returns the minutes number from the time field
  4878.       parameter.
  4879.  
  4880.       Ex.    minutes(system time)
  4881.  
  4882.       Ex.
  4883.  
  4884.       Unitsperhour = rounddown(60/(minutes(endtime)-
  4885.       minutes(starttime)))
  4886.  
  4887.       Acceptable parameters:
  4888.  
  4889.       System time
  4890.       Time field
  4891.       Maketime function
  4892.       Time expression
  4893.  
  4894.  
  4895.  
  4896.  
  4897.  
  4898.  
  4899.  
  4900.  
  4901.  
  4902.  
  4903.  
  4904.  
  4905.  
  4906.  
  4907.  
  4908.  
  4909.  
  4910.  
  4911.  
  4912.  
  4913.  
  4914.  
  4915.  
  4916.  
  4917.  
  4918.  
  4919.  
  4920.  
  4921.  
  4922.  
  4923.  
  4924.  
  4925.  
  4926.  
  4927.  
  4928.  
  4929.  
  4930.                                 - 83 -
  4931. ................................................................................
  4932.       MOD                        FUNCTION                         MOD
  4933.  
  4934.       The Mod function returns the remainder of an integer division
  4935.  
  4936.       Ex. surplus rounds = mod(bullets,soldiers * ammoissue)
  4937.  
  4938.  
  4939.       Ex.
  4940.  
  4941.       for Historydates
  4942.          historydates.leapyear = "No"
  4943.          if mod(historydates.year,4) = 0 then
  4944.             historydates.leapyear = "Yes"
  4945.             update record
  4946.          end if
  4947.       next
  4948.       < This example fills a new field "leapyear" which has been
  4949.       added to the "Historydates" form after data has been entered>
  4950.  
  4951.       Acceptable parameters:
  4952.  
  4953.       Numeric value
  4954.       Numeric expression
  4955.       Numeric field/variable
  4956.       Any other function which returns a numeric value
  4957.  
  4958.  
  4959.  
  4960.  
  4961.  
  4962.  
  4963.  
  4964.  
  4965.  
  4966.  
  4967.  
  4968.  
  4969.  
  4970.  
  4971.  
  4972.  
  4973.  
  4974.  
  4975.  
  4976.  
  4977.  
  4978.  
  4979.  
  4980.  
  4981.  
  4982.  
  4983.  
  4984.  
  4985.  
  4986.  
  4987.                                 - 84 -
  4988. ................................................................................
  4989.       MONTH                      FUNCTION                       MONTH
  4990.  
  4991.       This function returns the month number from a date parameter.
  4992.  
  4993.       Ex.    Month(system date)
  4994.  
  4995.       Ex.    Month(birthdate)
  4996.  
  4997.  
  4998.       Acceptable parameters
  4999.  
  5000.       System date
  5001.       Date field
  5002.       Makedate function
  5003.       Date expression
  5004.  
  5005.  
  5006.  
  5007.  
  5008.  
  5009.  
  5010.  
  5011.  
  5012.  
  5013.  
  5014.  
  5015.  
  5016.  
  5017.  
  5018.  
  5019.  
  5020.  
  5021.  
  5022.  
  5023.  
  5024.  
  5025.  
  5026.  
  5027.  
  5028.  
  5029.  
  5030.  
  5031.  
  5032.  
  5033.  
  5034.  
  5035.  
  5036.  
  5037.  
  5038.  
  5039.  
  5040.  
  5041.  
  5042.  
  5043.  
  5044.                                 - 85 -
  5045. ................................................................................
  5046.       MULTIPLE LINES         PROCEDURE COMMAND         MULTIPLE LINES
  5047.  
  5048.       You can place multiple code instructions on a single line of
  5049.       the code editor by separating them with a colon.
  5050.  
  5051.       Ex.
  5052.  
  5053.       for ledger with lineno = input.lineno
  5054.          ledger.net = input.net:ledger.vat = input.vat
  5055.          ledger.acno = input.acno:ledger.gross = input.gross
  5056.          update record
  5057.       next
  5058.  
  5059.  
  5060.  
  5061.  
  5062.  
  5063.  
  5064.  
  5065.  
  5066.  
  5067.  
  5068.  
  5069.  
  5070.  
  5071.  
  5072.  
  5073.  
  5074.  
  5075.  
  5076.  
  5077.  
  5078.  
  5079.  
  5080.  
  5081.  
  5082.  
  5083.  
  5084.  
  5085.  
  5086.  
  5087.  
  5088.  
  5089.  
  5090.  
  5091.  
  5092.  
  5093.  
  5094.  
  5095.  
  5096.  
  5097.  
  5098.  
  5099.  
  5100.  
  5101.                                 - 86 -
  5102. ................................................................................
  5103.       Next Batch             Procedure Command             Next Batch
  5104.  
  5105.       The Next Batch command resets the batch menu pointer from
  5106.       within a procedure. By using the Next Batch command you can
  5107.       cause a batch of procedures to repeat without returning to the
  5108.       menu in the same way that you can repeat a single procedure
  5109.       with an input screen.
  5110.  
  5111.       For example, in a variable length invoicing system you might
  5112.       have three procedures on a batch menu. The first procedure
  5113.       selects the current customer and invoice number, the second
  5114.       writes invoice lines to the lineitems form and the third prints
  5115.       the invoice. To have the entire process repeated after each
  5116.       invoice the last line of the last procedure should be:
  5117.  
  5118.       Next Batch 1
  5119.  
  5120.       Similarly, if the user inadvertently selects the wrong customer
  5121.       in the first procedure you can use an input screen field in the
  5122.       second to return to the first.
  5123.  
  5124.       If input.reselect = "yes" then Next Batch 1
  5125.  
  5126.       By using Next Batch and Global Number you can create a batch
  5127.       menu which reacts like a single procedure repeating until the
  5128.       Escape key is pressed.
  5129.  
  5130.       To exit from a batch of procedures on the escape key, set
  5131.       Global Number to 1 in the first procedure and to 0 in the last.
  5132.       Add a procedure immediately after the first with the code:-
  5133.  
  5134.       If Global Number = 0 then exit batch menu
  5135.  
  5136.  
  5137.  
  5138.  
  5139.  
  5140.  
  5141.  
  5142.  
  5143.  
  5144.  
  5145.  
  5146.  
  5147.  
  5148.  
  5149.  
  5150.  
  5151.  
  5152.  
  5153.  
  5154.  
  5155.  
  5156.  
  5157.  
  5158.                                 - 87 -
  5159. ................................................................................
  5160.       ODD/EVEN PAGE PRINT    PROCEDURE COMMAND    ODD/EVEN PAGE PRINT
  5161.  
  5162.       If you want to print procedure output on both sides of the
  5163.       paper then, unless you have a VERY expensive printer, the only
  5164.       way to achieve this is to print the odd pages, turn your paper
  5165.       over and print the even pages.  For a short report you can do
  5166.       this by setting paper feed to "Manual" from the utilities menu
  5167.       and turning each sheet over individually. If, however, you have
  5168.       a cut sheet feeder or a cartridge fed printer it is much
  5169.       quicker to print all the odd pages, turn them all over and then
  5170.       print all the even pages.
  5171.  
  5172.       To do this in Easy Base, issue the command "Odd Page Print"
  5173.       immediately before the print output and "Even Page Print"
  5174.       immediately after it.
  5175.  
  5176.       declare output fields
  5177.          customers.name : customers.phone
  5178.       end
  5179.       odd page print
  5180.       for customers with surname in order
  5181.          if bottom margin < .75 then page feed
  5182.          print list items
  5183.       next
  5184.       even page print    '(Easy Base pauses here till you are ready)
  5185.  
  5186.       If you will be binding your printed report down the left hand
  5187.       edge then you will need a larger left margin on the odd pages
  5188.       than on the even. If you start odd page printing with the
  5189.       command "Odd Page Print for Binding" then Easy Base will add
  5190.       half an inch to the format left margin when it prints the odd
  5191.       pages. You cannot alter the fixed value of half an inch but if
  5192.       you create your output format with a left margin of half an
  5193.       inch(suitable for the even pages) and print for binding, you
  5194.       will find that the resulting output suits most office binding
  5195.       systems.
  5196.  
  5197.       If you use Odd/Even page printing then it is important that you
  5198.       realize it is achieved by running the portion of your procedure
  5199.       between the "Odd Page Print" and "Even Page Print" twice -
  5200.       simply cancelling output to the printer at the appropriate
  5201.       times.  You must not, therefore include any commands which add,
  5202.       update or delete records between the commands. If you do they
  5203.       will be performed twice. Similarly if you are running a loop
  5204.       counter during the print process then it will have double the
  5205.       expected value after the "Even Page Print" command.
  5206.  
  5207.       The system value "Page Number" is reset to one at the "Even
  5208.       Page Print" command. If you include two separate sets of odd
  5209.       and even printing in a single procedure then you cannot use
  5210.       "Page Number" to number the second printout. You can of course
  5211.       use an ad hoc field. Just remember to reset it to one
  5212.       immediately before the "Even Page Print" command.
  5213.  
  5214.  
  5215.                                 - 88 -
  5216. ................................................................................
  5217.       ODD/EVEN PAGE PRINT    PROCEDURE COMMAND    ODD/EVEN PAGE PRINT
  5218.  
  5219.       This document was written in an Easy Base form "Ref" which has
  5220.       fields "Name", "Type", "Pageno" "Topicpage" and three text
  5221.       block fields "T1", "T2" and "T3". Each record holds one page of
  5222.       the reference manual and the pages were entered in no
  5223.       particular order. The following procedure was used to number,
  5224.       sort, index and print the manual.
  5225.  
  5226.       declare output fields
  5227.          ref.name : ref.type :ref.pageno
  5228.          ref.t1 : ref.t2 : ref.t3 : type : name
  5229.       end
  5230.       declare variables
  5231.          x as number : y as number
  5232.          namelen as number : typelen as number
  5233.       end
  5234.       '.....................NUMBER REFERENCE PAGES....
  5235.       for ref with name in order
  5236.          y = ref.total records
  5237.          x = x + 1
  5238.          display status "Numbering page" + x + "of" + y
  5239.          ref.pageno = x : update record
  5240.       next
  5241.       odd page print for binding
  5242.       '...............PRINT COMMANDS INDEX........
  5243.       bold on : print commandheader : bold off
  5244.       for ref with type = "procedure command"
  5245.          subindex name
  5246.       next
  5247.       for ref with subindex in order
  5248.          if topicpage > 1 then skiprec  'only first page
  5249.          ref.name = proper(ref.name)    'of each topic listed
  5250.          print commands
  5251.       next
  5252.       '..............PRINT SYSTEM VALUES INDEX...
  5253.       bold on : print valuesheader : bold off
  5254.       for ref with type = "system value"
  5255.          subindex name
  5256.       next
  5257.       for ref with subindex in order
  5258.          if topicpage > 1  then skiprec
  5259.          ref.name = proper(ref.name)
  5260.          print values
  5261.       next
  5262.       page feed       '... eject first index page
  5263.  
  5264.       '......... subsequent index pages are produced with exactly
  5265.       '........ the sane code as above and are omitted for clarity.
  5266.  
  5267.       '......................MAIN REFERENCE.............
  5268.       page feed
  5269.       for ref with name in order
  5270.          namelen = lengthtext(ref.name)
  5271.  
  5272.                                 - 89 -
  5273. ................................................................................
  5274.       ODD/EVEN PAGE PRINT    PROCEDURE COMMAND    ODD/EVEN PAGE PRINT
  5275.  
  5276.          typelen = lengthtext(ref.type)
  5277.          '....centre justify type
  5278.          type = jointext(stringof((20-typelen)/2,chr$(255)),ref.type)
  5279.          '....right justify name
  5280.          name = jointext(stringof(20-namelen,chr$(255)),ref.name)
  5281.          bold on : print refheader : bold off  'type and names fields
  5282.          print list items                      't1, t2, t3
  5283.          bold on print reffoot                 'pageno
  5284.          page feed
  5285.       next
  5286.       even page print
  5287.  
  5288.  
  5289.  
  5290.  
  5291.  
  5292.  
  5293.  
  5294.  
  5295.  
  5296.  
  5297.  
  5298.  
  5299.  
  5300.  
  5301.  
  5302.  
  5303.  
  5304.  
  5305.  
  5306.  
  5307.  
  5308.  
  5309.  
  5310.  
  5311.  
  5312.  
  5313.  
  5314.  
  5315.  
  5316.  
  5317.  
  5318.  
  5319.  
  5320.  
  5321.  
  5322.  
  5323.  
  5324.  
  5325.  
  5326.  
  5327.  
  5328.  
  5329.                                 - 90 -
  5330. ................................................................................
  5331.       Open                     File Command                      Open
  5332.  
  5333.       The "Open" command is used to open a non-Easy Base file.
  5334.  
  5335.       The filename can be supplied within quotes or as a text
  5336.       variable or field.
  5337.  
  5338.       The filename can include a complete path. If a path is not
  5339.       included then the file is opened in the Easy Base System
  5340.       directory.
  5341.  
  5342.       If the filename supplied is that of an existing file, that file
  5343.       is opened for access with the Read or Write commands. If there
  5344.       is no file with the supplied filename then a new file with that
  5345.       name is created and opened.
  5346.  
  5347.       Ex.
  5348.  
  5349.       Open "C:\config.sys"
  5350.  
  5351.       Open Files.name
  5352.  
  5353.       Open jointext("C:\wp\",input.filename)
  5354.  
  5355.       See also: Close, Seek, Read, Write, Find, Erase
  5356.  
  5357.  
  5358.  
  5359.  
  5360.  
  5361.  
  5362.  
  5363.  
  5364.  
  5365.  
  5366.  
  5367.  
  5368.  
  5369.  
  5370.  
  5371.  
  5372.  
  5373.  
  5374.  
  5375.  
  5376.  
  5377.  
  5378.  
  5379.  
  5380.  
  5381.  
  5382.  
  5383.  
  5384.  
  5385.  
  5386.                                 - 91 -
  5387. ................................................................................
  5388.       OPERATORS                 ARITHMETIC                  OPERATORS
  5389.  
  5390.       The arithmetic operators used in Easy Base are:-
  5391.  
  5392.       +   (addition)
  5393.  
  5394.       -   (subtraction and negation)
  5395.  
  5396.       *   (multiplication)
  5397.  
  5398.       /   (division)
  5399.  
  5400.       ^   (exponentiation)
  5401.  
  5402.       Where there are multiple operators in a derivation they are
  5403.       processed with the following precedence:-
  5404.  
  5405.       1.   Exponentiation
  5406.       2.   Negation
  5407.       3.   Multiplication and Division
  5408.       4.   Addition and Subtraction
  5409.  
  5410.       The default precedence can be altered by the use of
  5411.       parenthesis.
  5412.  
  5413.            Easy base does not perform Integer Arithmetic.
  5414.  
  5415.       When a numeric field shows the result of a division the
  5416.       "displayed" number is "truncated" to an integer in Integer
  5417.       fields and has the last digit rounded in Fixed Point and
  5418.       Floating Point fields.  The "Stored" value which is used in any
  5419.       further calculations, however, is always correct to 15
  5420.       significant figures irrelevant of field type.  For Example: If
  5421.       three fields x,y and z are defined as integers, y is derived as
  5422.       x/4 and z is derived as y*4 then when 9 is entered in x, y will
  5423.       derive as 2 but z will derive as 9 because it multiplies the
  5424.       "stored value" of 2.25 by 4 not the displayed value of 2.
  5425.  
  5426.       Handling arithmetic in this way means that, by default there
  5427.       are no rounding errors. This has several advantages not least
  5428.       that currency values need only ever be defined to two decimal
  5429.       places.
  5430.  
  5431.       It does mean, however, that should you require rounding errors
  5432.       to be carried forward you must use one of the Easy Base
  5433.       rounding functions on the result of any intermediate division.
  5434.  
  5435.       In the above example, had y been derived as "round(x/4)" then z
  5436.       would derive as 8.
  5437.  
  5438.       If a fourth field had the formula:- if(y = 2,5,10) it would
  5439.       only derive as 5 if y had been rounded or if 8 had been entered
  5440.       in x.
  5441.  
  5442.  
  5443.                                 - 92 -
  5444. ................................................................................
  5445.       OPERATORS                 RELATIONAL                  OPERATORS
  5446.  
  5447.       Easy base uses the following relational operators:-
  5448.  
  5449.       =    (equals)
  5450.       <>   (not equals)
  5451.       >    (greater than)
  5452.       <    (less than)
  5453.       >=   (greater than or equal to)
  5454.       <=   (less than or equal to)
  5455.  
  5456.  
  5457.       Where relational operators and arithmetic operators are both
  5458.       used in a derivation. Relational operations are performed after
  5459.       arithmetic operations.
  5460.  
  5461.       Text values are not case sensitive when compared with
  5462.       relational operators.
  5463.  
  5464.       When you compare two fields or variables, the comparison is
  5465.       numeric if both are numeric and alphabetic if both are
  5466.       alphabetic.  If you compare a numeric field with a text field
  5467.       then Easy Base will test to see if the text field contains a
  5468.       number.  If it does then the comparison will be numeric and if
  5469.       it does not then the comparison will be alphabetic.
  5470.  
  5471.       WARNING
  5472.  
  5473.       If you compare the result of a division in an integer or fixed
  5474.       point field using the = or the <> operators, then the value
  5475.       used for comparison will be the (accurate) stored value and not
  5476.       the "Truncated" number shown in the field.
  5477.  
  5478.       See Operators Arithmetic
  5479.  
  5480.  
  5481.  
  5482.  
  5483.  
  5484.  
  5485.  
  5486.  
  5487.  
  5488.  
  5489.  
  5490.  
  5491.  
  5492.  
  5493.  
  5494.  
  5495.  
  5496.  
  5497.  
  5498.  
  5499.  
  5500.                                 - 93 -
  5501. ................................................................................
  5502.       OPERATORS                  LOGICAL                    OPERATORS
  5503.  
  5504.       Easy Base uses the following logical operators:-
  5505.  
  5506.       1.  and
  5507.       2.  or
  5508.       3.  xor     (or exclusive)
  5509.       4.  eqv     (equivalence)
  5510.       5.  imp     (implication)
  5511.  
  5512.       Logical operations are performed last after arithmetic and
  5513.       relational.
  5514.  
  5515.       Logical operators return a boolean (true or false) value from
  5516.       two other boolean expressions.
  5517.  
  5518.       Ex.
  5519.  
  5520.       If(x = y and a = b,"Yes","No")
  5521.          < Yes is returned if both expressions are true >
  5522.  
  5523.       If(x = y or a = b,"Yes","No")
  5524.          < Yes is returned if either or both expressions are true >
  5525.  
  5526.       If(x = y xor a = b,"Yes","No")
  5527.          < Yes is returned if either one but not both are true >
  5528.  
  5529.       If(x = y eqv a = b,"Yes","No")
  5530.          < Yes is returned if both expressions are true or if both
  5531.            expressions are false >
  5532.  
  5533.       If(x = y imp a = b,"Yes","No")
  5534.  
  5535.          < Yes is returned for all combinations except the first
  5536.            expression being true and the second false >
  5537.  
  5538.       The Easy Base logical operators are primarily designed for use
  5539.       within the "If" function and in "If..Then..Else" constructions
  5540.       where their actual value is not relevant. If you wish to use
  5541.       the value of "false" in formulae then it is represented by 0.
  5542.       True can be represented by any value other than 0 and should
  5543.       not be used.
  5544.  
  5545.  
  5546.  
  5547.  
  5548.  
  5549.  
  5550.  
  5551.  
  5552.  
  5553.  
  5554.  
  5555.  
  5556.  
  5557.                                 - 94 -
  5558. ................................................................................
  5559.       OPTIONS                    UTILITY                      OPTIONS
  5560.  
  5561.       The "Options" utility allows you to select your preferred date
  5562.       format (European or North American).
  5563.  
  5564.       You can also enable or disable screen saving. If enabled the
  5565.       screen saver operates after three minutes without a keypress
  5566.       during record entry, procedure screen entry or if a menu is
  5567.       being displayed. The screensaver is never invoked while a
  5568.       procedure is running or while reformatting or re-indexing is
  5569.       taking place.
  5570.  
  5571.       The third option allows you to select the border style you
  5572.       require around menus and message boxes.
  5573.  
  5574.       Option four selects whether or not screen clearing will be done
  5575.       with the curtain effect.
  5576.  
  5577.       Option five selects the COM port which will be used during
  5578.       Auto-dialling.
  5579.  
  5580.       The options utility can be called as a user menu function so
  5581.       that an end user can access the facilities without access to
  5582.       the system menus.
  5583.  
  5584.  
  5585.  
  5586.  
  5587.  
  5588.  
  5589.  
  5590.  
  5591.  
  5592.  
  5593.  
  5594.  
  5595.  
  5596.  
  5597.  
  5598.  
  5599.  
  5600.  
  5601.  
  5602.  
  5603.  
  5604.  
  5605.  
  5606.  
  5607.  
  5608.  
  5609.  
  5610.  
  5611.  
  5612.  
  5613.  
  5614.                                 - 95 -
  5615. ................................................................................
  5616.       OUTPUT                   SYSTEM VALUE                    OUTPUT
  5617.  
  5618.       When a user runs a procedure his choice of output, screen,
  5619.       printer or disk is stored in the system value "Output".
  5620.  
  5621.       By accessing the system value "Output" you can make your
  5622.       procedure do different things depending on where the output is
  5623.       to be sent.
  5624.  
  5625.       Ex.
  5626.  
  5627.       if output = "screen" then
  5628.          print heading1
  5629.       else
  5630.          print heading2
  5631.       end if
  5632.  
  5633.  
  5634.  
  5635.  
  5636.  
  5637.  
  5638.  
  5639.  
  5640.  
  5641.  
  5642.  
  5643.  
  5644.  
  5645.  
  5646.  
  5647.  
  5648.  
  5649.  
  5650.  
  5651.  
  5652.  
  5653.  
  5654.  
  5655.  
  5656.  
  5657.  
  5658.  
  5659.  
  5660.  
  5661.  
  5662.  
  5663.  
  5664.  
  5665.  
  5666.  
  5667.  
  5668.  
  5669.  
  5670.  
  5671.                                 - 96 -
  5672. ................................................................................
  5673.       Pack                   Procedure Command                   Pack
  5674.  
  5675.       Network Versions only.
  5676.  
  5677.       Form packing can be initiated within a procedure.
  5678.  
  5679.       Syntax: Pack formname
  5680.  
  5681.       Example:
  5682.  
  5683.       Lock Clients
  5684.       For Clients with name = input.name
  5685.          delete record
  5686.       next
  5687.       Pack Clients
  5688.       Unlock Clients
  5689.  
  5690.       The Pack command must not be executed within a for or do loop.
  5691.  
  5692.  
  5693.  
  5694.  
  5695.  
  5696.  
  5697.  
  5698.  
  5699.  
  5700.  
  5701.  
  5702.  
  5703.  
  5704.  
  5705.  
  5706.  
  5707.  
  5708.  
  5709.  
  5710.  
  5711.  
  5712.  
  5713.  
  5714.  
  5715.  
  5716.  
  5717.  
  5718.  
  5719.  
  5720.  
  5721.  
  5722.  
  5723.  
  5724.  
  5725.  
  5726.  
  5727.  
  5728.                                 - 97 -
  5729. ................................................................................
  5730.       PACK DATA FORMS            UTILITY              PACK DATA FORMS
  5731.  
  5732.       The process of actually removing a deleted record from a form
  5733.       is time consuming. What actually happens is that all the "Live"
  5734.       records are copied to a temporary file. The original file is
  5735.       then deleted and the temporary one re-named to the original
  5736.       name. Because of this it is actually quicker to remove fifty
  5737.       "Dead" records than it is to remove one. To save you time Easy
  5738.       base follows the traditional data-base custom of simply marking
  5739.       records for deletion when you delete them. They are only
  5740.       physically removed from the form during a "Pack" operation.
  5741.       When you "Pack" a data file Easy Base also re-writes all the
  5742.       index files for that form. You can pack individual forms with
  5743.       the "Pack Data Forms" utility accessed from the Utilities menu.
  5744.       You can also call the "Pack Data Forms" utility as a User menu
  5745.       function. In a finished application any necessary packing would
  5746.       normally be done from a batch execute menu which would run
  5747.       while the computer was unattended.
  5748.  
  5749.       Forms in which records are regularly deleted should be packed
  5750.       regularly. If packing is not done then not only will you be
  5751.       wasting disk space but search operations will become
  5752.       progressively slower as the percentage of "Dead" records
  5753.       increases.
  5754.  
  5755.       This is fairly obvious - however it is not so obvious that a
  5756.       forms index files can accumulate "Dead" records even though
  5757.       none have been deleted from the main file. An index file is
  5758.       simply the indexed fields contents and record number arranged
  5759.       in order. If, having filed a record you then alter the contents
  5760.       of an indexed field and update the record then the original
  5761.       record in the index file is deleted and a new one entered.
  5762.  
  5763.       Index files with "Dead records" also waste disk space and slow
  5764.       search operations. You should therefore regularly pack any
  5765.       forms which are regularly updated.
  5766.  
  5767.       If you are unsure which forms need to be packed you can use the
  5768.       "Auto-Pack" utility which tests each form and each forms index
  5769.       files for "Dead" records. The form is packed if it or any of
  5770.       its index files is found to have more then 100 total or 10 per
  5771.       cent "Dead" records.
  5772.  
  5773.       Although "Auto-Pack" may seem the easy answer, an application
  5774.       will almost certainly have several forms with "Core" data which
  5775.       remain unchanged and therefore never require packing. If you
  5776.       can identify the forms which do need to be packed and do them
  5777.       individually or from a batch execute menu this will be less
  5778.       time consuming than always using the "Auto-Pack" facility.
  5779.  
  5780.  
  5781.  
  5782.  
  5783.  
  5784.  
  5785.                                 - 98 -
  5786. ................................................................................
  5787.       PAGE NUMBER              SYSTEM VALUE               PAGE NUMBER
  5788.  
  5789.       Whenever Easy Base is processing a procedure with an output it
  5790.       keeps track of the current page number (Even if you have not
  5791.       included Page Feed commands). You can use the system value
  5792.       "Page Number" to number the pages of your output. To use the
  5793.       "Page Number" value just include "Page Number" in your output
  5794.       field declarations.
  5795.  
  5796.       Declare output fields
  5797.          Customers.name : Customers.ACNO : Page Number
  5798.       end
  5799.  
  5800.       You can then use the "Page Number" field in the Page Header or
  5801.       Page Footer section of your output format.
  5802.  
  5803.  
  5804.  
  5805.  
  5806.  
  5807.  
  5808.  
  5809.  
  5810.  
  5811.  
  5812.  
  5813.  
  5814.  
  5815.  
  5816.  
  5817.  
  5818.  
  5819.  
  5820.  
  5821.  
  5822.  
  5823.  
  5824.  
  5825.  
  5826.  
  5827.  
  5828.  
  5829.  
  5830.  
  5831.  
  5832.  
  5833.  
  5834.  
  5835.  
  5836.  
  5837.  
  5838.  
  5839.  
  5840.  
  5841.  
  5842.                                 - 99 -
  5843. ................................................................................
  5844.       PAUSE ON/OFF           PROCEDURE COMMAND           PAUSE ON/OFF
  5845.  
  5846.       When an Easy Base procedure has an output to the screen, the
  5847.       output, by default scrolls continuously until the procedure is
  5848.       complete. You can allow the user to pause the output with the
  5849.       "Pause On" and "AutoPause On" commands.
  5850.  
  5851.       If a procedure performs several tasks then the pause facility
  5852.       can be selectively enabled and disabled at any point.
  5853.  
  5854.       Ex.
  5855.  
  5856.       for employees alias types with type in order unique
  5857.          pause off:escape off
  5858.          for employees alias group with type = types.type
  5859.             subindex surname
  5860.          next
  5861.          pause on
  5862.          for employees with subindex in order
  5863.             print list items
  5864.          next
  5865.       next
  5866.  
  5867.       The above code fragment prints employees details in type groups
  5868.       with surname in alphabetic order. During the procedure the user
  5869.       can pause the report while it is listing the output but not
  5870.       while it is subindexing the group.
  5871.  
  5872.       If you set pausing with "Pause On" then the user can pause the
  5873.       output at any point by pressing the return key. If you set
  5874.       pausing with "Autopause On" then the output stops after each
  5875.       screen page of output.
  5876.  
  5877.       If you set "Autopause On" and "Escape On" then the first press
  5878.       of the Escape key cancels the autopausing and the second press
  5879.       terminates the output.
  5880.  
  5881.       "Pause Off" cancels either.
  5882.  
  5883.       If a procedure has pausing set by "Autopause On" and its output
  5884.       is directed to the printer, Easy Base automatically switches to
  5885.       "Pause On"
  5886.  
  5887.       See also: Escape On/Off
  5888.  
  5889.  
  5890.  
  5891.  
  5892.  
  5893.  
  5894.  
  5895.  
  5896.  
  5897.  
  5898.  
  5899.                                 - 100 -
  5900. ................................................................................
  5901.       PI                       SYSTEM VALUE                        PI
  5902.  
  5903.       You can use the value of π anywhere in field derivations or
  5904.       procedure code by quoting "Pi".
  5905.  
  5906.       Ex     circlearea = Pi / 4 diam^2
  5907.  
  5908.  
  5909.  
  5910.  
  5911.  
  5912.  
  5913.  
  5914.  
  5915.  
  5916.  
  5917.  
  5918.  
  5919.  
  5920.  
  5921.  
  5922.  
  5923.  
  5924.  
  5925.  
  5926.  
  5927.  
  5928.  
  5929.  
  5930.  
  5931.  
  5932.  
  5933.  
  5934.  
  5935.  
  5936.  
  5937.  
  5938.  
  5939.  
  5940.  
  5941.  
  5942.  
  5943.  
  5944.  
  5945.  
  5946.  
  5947.  
  5948.  
  5949.  
  5950.  
  5951.  
  5952.  
  5953.  
  5954.  
  5955.  
  5956.                                 - 101 -
  5957. ................................................................................
  5958.       PRESELECT              PROCEDURE COMMAND              PRESELECT
  5959.  
  5960.       The "Preselect" command sets highlighting of the next user menu
  5961.       when the procedure terminates.  If a procedure is normally
  5962.       followed by a particular selection from the menu then you can
  5963.       save the user the trouble of choosing it by issuing the
  5964.       "Preselect" command within the procedure.
  5965.  
  5966.       for currentcustomer
  5967.          currentcustomer.acno = input.acno
  5968.          update record
  5969.       next
  5970.       preselect 4
  5971.  
  5972.       The parameter cannot be supplied as a variable.
  5973.  
  5974.  
  5975.  
  5976.  
  5977.  
  5978.  
  5979.  
  5980.  
  5981.  
  5982.  
  5983.  
  5984.  
  5985.  
  5986.  
  5987.  
  5988.  
  5989.  
  5990.  
  5991.  
  5992.  
  5993.  
  5994.  
  5995.  
  5996.  
  5997.  
  5998.  
  5999.  
  6000.  
  6001.  
  6002.  
  6003.  
  6004.  
  6005.  
  6006.  
  6007.  
  6008.  
  6009.  
  6010.  
  6011.  
  6012.  
  6013.                                 - 102 -
  6014. ................................................................................
  6015.       PRINT                  PROCEDURE COMMAND                  PRINT
  6016.  
  6017.       In Easy Base procedures, all output to the screen or printer is
  6018.       initiated with the "Print" command. The "Print" command prints
  6019.       sections from the procedures output format.
  6020.  
  6021.       Ex.
  6022.  
  6023.       '......................procedure code....
  6024.       Print report header
  6025.       for customers
  6026.          print list items
  6027.       next
  6028.       print report footer
  6029.       '......................Output Format.......
  6030.       .Report Header
  6031.             ════════════════════════════════════════════════
  6032.                           Customer List
  6033.             ════════════════════════════════════════════════
  6034.       .List Items
  6035.             {customers.name field}  {customers.phone field}
  6036.       .Report Footer
  6037.             ════════════════════════════════════════════════
  6038.       .end
  6039.  
  6040.       The format sections are marked with a full stop in the margin
  6041.       followed by the section name. When you type a full stop in the
  6042.       margin of the "Format editor" Easy Base will offer you a
  6043.       selection of section names. You do not have to use these - they
  6044.       are just some common names that can save you time. To enter
  6045.       your own section names just press escape and type in any name
  6046.       you wish.
  6047.  
  6048.       The ".end" section is not strictly necessary but it is easy to
  6049.       accidentally insert blank lines at the end of your format. By
  6050.       inserting ".end" at the end of the last section you will
  6051.       prevent these from being printed.
  6052.  
  6053.  
  6054.  
  6055.  
  6056.  
  6057.  
  6058.  
  6059.  
  6060.  
  6061.  
  6062.  
  6063.  
  6064.  
  6065.  
  6066.  
  6067.  
  6068.  
  6069.  
  6070.                                 - 103 -
  6071. ................................................................................
  6072.       PRINTER CONTROL        PROCEDURE COMMAND        PRINTER CONTROL
  6073.  
  6074.       When you send a procedure output to the printer Easy Base will
  6075.       initialize your printer at ten characters per inch, six lines
  6076.       per inch in draft mode.
  6077.  
  6078.       You can alter the printer mode anywhere within a procedure with
  6079.       the following printer controls.
  6080.  
  6081.       Bold On            Bold Off
  6082.       Underline On       Underline Off  (Underlines field contents)
  6083.       Italic On          Italic Off
  6084.       NLQ On             NLQ Off
  6085.  
  6086.       8 lpi      Sets printing to eight lines per inch
  6087.       6 lpi      Sets printing to six lines per inch
  6088.       10 cpi     Sets printing to ten characters per inch
  6089.       12 cpi     Sets printing to twelve characters per inch
  6090.       17 cpi     sets printing to either 15 or 17 depending on
  6091.                  printer
  6092.       Line Feed  Advances the print head one line
  6093.       Page Feed  Ejects the current page.
  6094.       Landscape  Prints in landscape ( HP DeskJet/LaserJet only )
  6095.  
  6096.       Ex.
  6097.       NLQ On
  6098.       Bold on
  6099.       Print report header
  6100.       Bold Off
  6101.       12 CPI
  6102.       For customers
  6103.          print list items
  6104.          if bottom margin < 1.5 then
  6105.             Line feed : Bold On : 10 CPI
  6106.             Print Page footer
  6107.             Page feed
  6108.             Print Page header
  6109.             Bold Off : 12 CPI
  6110.          end if
  6111.       next
  6112.       Bold on:Italic On :10 CPI
  6113.       print report footer
  6114.  
  6115.  
  6116.       The above example turns Near Letter Quality printing on for the
  6117.       entire report. It prints page headers and footers in bold at 10
  6118.       characters per inch, list items at 12 characters per inch and
  6119.       the report footer in bold italics.
  6120.  
  6121.  
  6122.  
  6123.  
  6124.  
  6125.  
  6126.  
  6127.                                 - 104 -
  6128. ................................................................................
  6129.       Prog_Dir                 System Value                  Prog_Dir
  6130.  
  6131.       Whenever you run a procedure in Easy Base the drive and
  6132.       directory of the program files is available in the system value
  6133.       Prog_Dir.
  6134.  
  6135.       If you write applications for resale on the Easy Base Runtime
  6136.       module then you will not necessarily know the name of the
  6137.       directory to which the end user has installed your application.
  6138.       If your application opens external files you can ensure that
  6139.       they are in the Application directory by using Prog_Dir.
  6140.  
  6141.  
  6142.       declare variables
  6143.          pathfile as text
  6144.       end
  6145.       pathfile = jointext(Prog_Dir,"\NAMES.TXT")
  6146.       open pathfile
  6147.  
  6148.  
  6149.  
  6150.  
  6151.  
  6152.  
  6153.  
  6154.  
  6155.  
  6156.  
  6157.  
  6158.  
  6159.  
  6160.  
  6161.  
  6162.  
  6163.  
  6164.  
  6165.  
  6166.  
  6167.  
  6168.  
  6169.  
  6170.  
  6171.  
  6172.  
  6173.  
  6174.  
  6175.  
  6176.  
  6177.  
  6178.  
  6179.  
  6180.  
  6181.  
  6182.  
  6183.  
  6184.                                 - 105 -
  6185. ................................................................................
  6186.       PROPER                     FUNCTION                      PROPER
  6187.  
  6188.       This function returns the parameter with the first letter of
  6189.       each word in upper case and the rest in lower case. If you wish
  6190.       to enter initials in a field derived as proper and keep them in
  6191.       upper case then there must either be a space or a full stop
  6192.       between them.
  6193.  
  6194.       Ex.     Proper(Address)
  6195.  
  6196.       Ex.
  6197.  
  6198.       labelname = upper(company.name)
  6199.       insetname = proper(company.name)
  6200.  
  6201.  
  6202.       Acceptable parameters:
  6203.  
  6204.       Quoted text
  6205.       Text field/variable
  6206.  
  6207.  
  6208.  
  6209.  
  6210.  
  6211.  
  6212.  
  6213.  
  6214.  
  6215.  
  6216.  
  6217.  
  6218.  
  6219.  
  6220.  
  6221.  
  6222.  
  6223.  
  6224.  
  6225.  
  6226.  
  6227.  
  6228.  
  6229.  
  6230.  
  6231.  
  6232.  
  6233.  
  6234.  
  6235.  
  6236.  
  6237.  
  6238.  
  6239.  
  6240.  
  6241.                                 - 106 -
  6242. ................................................................................
  6243.       RANDOM                     FUNCTION                      RANDOM
  6244.  
  6245.       This function returns a random number between the upper and
  6246.       lower parameters.
  6247.  
  6248.       Ex.  Random(1,100)
  6249.          <Returns a random number between 1 and 100>
  6250.  
  6251.       Ex.  The two fields No and card simulate the random cutting of
  6252.       a deck of cards each time the No field is cleared.
  6253.  
  6254.       No field derivation:-
  6255.           if(no <> blank,no,random(1,52))
  6256.  
  6257.       Card field derivation:-
  6258.  
  6259.           jointext(if(mod(no,13) = 1,"Ace",mod(no,13) = 0,"King",
  6260.       mod(no,13) = 12,"Queen",mod(no,13) = 11,"Jack",mod(no,13)),
  6261.       " of ",if(no < 14,"Hearts",no < 27 ,"Clubs",no <40,"Diamonds",
  6262.       ,"Spades"))
  6263.  
  6264.  
  6265.       Acceptable parameters
  6266.  
  6267.       Numeric Value
  6268.       Numeric expression
  6269.       Numeric field/variable
  6270.       Any other function which returns a numeric value
  6271.  
  6272.  
  6273.  
  6274.  
  6275.  
  6276.  
  6277.  
  6278.  
  6279.  
  6280.  
  6281.  
  6282.  
  6283.  
  6284.  
  6285.  
  6286.  
  6287.  
  6288.  
  6289.  
  6290.  
  6291.  
  6292.  
  6293.  
  6294.  
  6295.  
  6296.  
  6297.  
  6298.                                 - 107 -
  6299. ................................................................................
  6300.       Read                     File Command                      Read
  6301.  
  6302.       The "Read" command reads data from a non Easy Base file which
  6303.       has been opened with the "Open" command.
  6304.  
  6305.       The syntax is:
  6306.       Read (Length) to (Field or variable)
  6307.  
  6308.       Length can be absolute, a variable or field or the keyword
  6309.       "Line".
  6310.  
  6311.       Ex.
  6312.  
  6313.       Read 45 to Keyvar
  6314.       Read GetLen to customers.name
  6315.       Read Line to Linestring
  6316.  
  6317.       In the "Line" example Easy Base reads from the current File_pos
  6318.       to the end of the current ASCII line.
  6319.  
  6320.       See also: Open, Close, Seek, Write, Find, Erase
  6321.  
  6322.  
  6323.  
  6324.  
  6325.  
  6326.  
  6327.  
  6328.  
  6329.  
  6330.  
  6331.  
  6332.  
  6333.  
  6334.  
  6335.  
  6336.  
  6337.  
  6338.  
  6339.  
  6340.  
  6341.  
  6342.  
  6343.  
  6344.  
  6345.  
  6346.  
  6347.  
  6348.  
  6349.  
  6350.  
  6351.  
  6352.  
  6353.  
  6354.  
  6355.                                 - 108 -
  6356. ................................................................................
  6357.       REBUILD DIRECTORIES        UTILITY          REBUILD DIRECTORIES
  6358.  
  6359.       In Easy Base, all DOS file handling is taken care of for you in
  6360.       the background. To do this Easy Base maintains three
  6361.       "Directory" files in which the names which you give to forms,
  6362.       procedures and choice field lists are linked to the actual DOS
  6363.       filenames.
  6364.  
  6365.       The three files are :-
  6366.  
  6367.       BASE.DIR     The forms directory
  6368.       PROC.DIR     The procedures directory
  6369.       CHOICES.DIR  The choice list directory
  6370.  
  6371.       Because these are key files, Easy Base includes a utility which
  6372.       will rebuild them in the event of accidental erasure or
  6373.       corruption.
  6374.  
  6375.  
  6376.  
  6377.  
  6378.  
  6379.  
  6380.  
  6381.  
  6382.  
  6383.  
  6384.  
  6385.  
  6386.  
  6387.  
  6388.  
  6389.  
  6390.  
  6391.  
  6392.  
  6393.  
  6394.  
  6395.  
  6396.  
  6397.  
  6398.  
  6399.  
  6400.  
  6401.  
  6402.  
  6403.  
  6404.  
  6405.  
  6406.  
  6407.  
  6408.  
  6409.  
  6410.  
  6411.  
  6412.                                 - 109 -
  6413. ................................................................................
  6414.       Recall Input Screen    Procedure Command    Recall Input Screen
  6415.  
  6416.       The Recall Input Screen command, available in network versions
  6417.       only, is used to return to the input screen when an error is
  6418.       detected after a procedure starts. Such errors are invariably
  6419.       caused by multiple work stations running the same procedure at
  6420.       the same time. A typical example would be when a procedure
  6421.       enters a record to a form and one of the fields has to be
  6422.       unique. If two work stations enter the same value for the
  6423.       unique field on their input screens, the error cannot be
  6424.       detected until the procedure is run. The following procedure
  6425.       code illustrates how a procedure can test to see if another
  6426.       workstation has entered the same value in the name field of the
  6427.       parts form.
  6428.  
  6429.       Declare variables
  6430.          x as number
  6431.       end
  6432.       For parts new record
  6433.          For Parts alias check with name = input.name
  6434.             x = x + 1
  6435.          Next
  6436.          if x > 0 then
  6437.             Beep
  6438.             Display status "This Part Name Has just been taken !"
  6439.             Delay 2000
  6440.             Recall Input Screen
  6441.          end if
  6442.          copy all from input
  6443.       next
  6444.  
  6445.       The Recall Input Screen command automatically preserves all the
  6446.       field data that had been entered on the input screen irrelevant
  6447.       of the screen's F12 setting for "Clear Screen after Running".
  6448.  
  6449.  
  6450.  
  6451.  
  6452.  
  6453.  
  6454.  
  6455.  
  6456.  
  6457.  
  6458.  
  6459.  
  6460.  
  6461.  
  6462.  
  6463.  
  6464.  
  6465.  
  6466.  
  6467.  
  6468.  
  6469.                                 - 110 -
  6470. ................................................................................
  6471.       RECORD NUMBER            SYSTEM VALUE             RECORD NUMBER
  6472.  
  6473.       If you derive a field with the formula "record number" it will
  6474.       be filled with the record number at the time of filing or
  6475.       reformatting.  Record number differs from "sequence" in the
  6476.       following way. Each time you derive a field with "sequence" you
  6477.       get the next sequencial number irrespective of whether the form
  6478.       has had records deleted and has been repacked. If a file has
  6479.       had at some time 500 records but now only has 20 the next
  6480.       derivation of "sequence" will be 501 and the next derivation of
  6481.       "record number" will be 21.
  6482.  
  6483.       The main use of "record number" is to renumber a set of records
  6484.       after deletions. To do this just add a new field to the form
  6485.       derived as record number. The field will be filled
  6486.       automatically during the data reformatting process.
  6487.  
  6488.       In procedures a records number is available as a pseudo field.
  6489.  
  6490.       Declare Output Fields
  6491.          Customers.Name
  6492.          Customers.Record number
  6493.       end
  6494.  
  6495.  
  6496.  
  6497.  
  6498.  
  6499.  
  6500.  
  6501.  
  6502.  
  6503.  
  6504.  
  6505.  
  6506.  
  6507.  
  6508.  
  6509.  
  6510.  
  6511.  
  6512.  
  6513.  
  6514.  
  6515.  
  6516.  
  6517.  
  6518.  
  6519.  
  6520.  
  6521.  
  6522.  
  6523.  
  6524.  
  6525.  
  6526.                                 - 111 -
  6527. ................................................................................
  6528.       REMARK                 PROCEDURE COMMAND                 REMARK
  6529.  
  6530.       You can place remarks anywhere within Easy base procedure code
  6531.       by prefixing them with an apostrophe.
  6532.  
  6533.       Ex.
  6534.  
  6535.       '.................This entire line is a remark.....
  6536.       for pupils with age > 9
  6537.          if grade = "g" then skip record   'exclude g's from count
  6538.          count = count + 1                 'These are remarks
  6539.       next
  6540.       '..............................................
  6541.  
  6542.       All text to the right of the apostrophe is ignored at run time.
  6543.  
  6544.  
  6545.  
  6546.  
  6547.  
  6548.  
  6549.  
  6550.  
  6551.  
  6552.  
  6553.  
  6554.  
  6555.  
  6556.  
  6557.  
  6558.  
  6559.  
  6560.  
  6561.  
  6562.  
  6563.  
  6564.  
  6565.  
  6566.  
  6567.  
  6568.  
  6569.  
  6570.  
  6571.  
  6572.  
  6573.  
  6574.  
  6575.  
  6576.  
  6577.  
  6578.  
  6579.  
  6580.  
  6581.  
  6582.  
  6583.                                 - 112 -
  6584. ................................................................................
  6585.       Reset Sequence         Procedure Command         Reset Sequence
  6586.  
  6587.       The reset sequence command (Network Versions only) can be used
  6588.       to reset the sequence number for any given form. The following
  6589.       code resets the sequence number for the customers form to 1000.
  6590.  
  6591.       For Customers
  6592.          Customers.Sequence = 1000
  6593.          Reset Sequence
  6594.          Exit For
  6595.       Next
  6596.  
  6597.  
  6598.  
  6599.  
  6600.  
  6601.  
  6602.  
  6603.  
  6604.  
  6605.  
  6606.  
  6607.  
  6608.  
  6609.  
  6610.  
  6611.  
  6612.  
  6613.  
  6614.  
  6615.  
  6616.  
  6617.  
  6618.  
  6619.  
  6620.  
  6621.  
  6622.  
  6623.  
  6624.  
  6625.  
  6626.  
  6627.  
  6628.  
  6629.  
  6630.  
  6631.  
  6632.  
  6633.  
  6634.  
  6635.  
  6636.  
  6637.  
  6638.  
  6639.  
  6640.                                 - 113 -
  6641. ................................................................................
  6642.       RESTORE                    UTILITY                      RESTORE
  6643.  
  6644.       Easy Base will restore applications or data which it has backed
  6645.       up. You can only restore an application with the "Restore
  6646.       Application" utility called from the utilities menu and you can
  6647.       only restore data-only backups with the "Restore Data" utility
  6648.       called from a user menu.
  6649.  
  6650.  
  6651.       See Also:-  Backup
  6652.  
  6653.  
  6654.  
  6655.  
  6656.  
  6657.  
  6658.  
  6659.  
  6660.  
  6661.  
  6662.  
  6663.  
  6664.  
  6665.  
  6666.  
  6667.  
  6668.  
  6669.  
  6670.  
  6671.  
  6672.  
  6673.  
  6674.  
  6675.  
  6676.  
  6677.  
  6678.  
  6679.  
  6680.  
  6681.  
  6682.  
  6683.  
  6684.  
  6685.  
  6686.  
  6687.  
  6688.  
  6689.  
  6690.  
  6691.  
  6692.  
  6693.  
  6694.  
  6695.  
  6696.  
  6697.                                 - 114 -
  6698. ................................................................................
  6699.       RETAIL                     FUNCTION                      RETAIL
  6700.  
  6701.       The retail function returns the retail price given the
  6702.       wholesale price and the discount as a percentage of retail.
  6703.  
  6704.       Ex   Retail(cost,discount)
  6705.  
  6706.            < returns 125 if cost = 100 and discount = 20>
  6707.  
  6708.  
  6709.  
  6710.  
  6711.  
  6712.  
  6713.  
  6714.  
  6715.  
  6716.  
  6717.  
  6718.  
  6719.  
  6720.  
  6721.  
  6722.  
  6723.  
  6724.  
  6725.  
  6726.  
  6727.  
  6728.  
  6729.  
  6730.  
  6731.  
  6732.  
  6733.  
  6734.  
  6735.  
  6736.  
  6737.  
  6738.  
  6739.  
  6740.  
  6741.  
  6742.  
  6743.  
  6744.  
  6745.  
  6746.  
  6747.  
  6748.  
  6749.  
  6750.  
  6751.  
  6752.  
  6753.  
  6754.                                 - 115 -
  6755. ................................................................................
  6756.       RETEST                 DERIVATION PREFIX                 RETEST
  6757.  
  6758.       In Easy Base, fields are derived when a new record is started
  6759.       and when any other field which affects the derivation is
  6760.       changed. You can force a field to be rederived when F2 is
  6761.       pressed by prefixing the derivation with "retest".
  6762.  
  6763.       Suppose you have a field "degrees" in which the user must enter
  6764.       a number between 1 and 360.
  6765.  
  6766.       To prevent him entering an out of range number you could derive
  6767.       the field :-
  6768.  
  6769.       If(degrees<1 or degrees > 360,blank[beepInvalid number of
  6770.       degreesCursor degrees],degrees)
  6771.  
  6772.       The above derivation would prevent the user from filing a
  6773.       record with an out of range number. However, by the time he
  6774.       read the message, his entry would be blanked out. It would be
  6775.       better if the number he had typed could be left in the field so
  6776.       that he could see his error. To do this all you have to do is
  6777.       change "blank" to "degrees" in the above derivation.
  6778.  
  6779.       This however would allow the user ( Should he decide to ignore
  6780.       the message ) to then file the incorrect value. To leave the
  6781.       value in the field and still prevent the user from filing it,
  6782.       use the "retest" prefix.
  6783.  
  6784.       Retest If(degrees<1 or degrees > 360,degrees[beepInvalid number
  6785.       of degreesCursor degrees],degrees)
  6786.  
  6787.  
  6788.       Note:-
  6789.  
  6790.       1. You can have more than one prefix on any one field
  6791.          derivation provided there is a space between each.
  6792.  
  6793.  
  6794.  
  6795.  
  6796.  
  6797.  
  6798.  
  6799.  
  6800.  
  6801.  
  6802.  
  6803.  
  6804.  
  6805.  
  6806.  
  6807.  
  6808.  
  6809.  
  6810.  
  6811.                                 - 116 -
  6812. ................................................................................
  6813.       REVERSE                    FUNCTION                     REVERSE
  6814.  
  6815.       The reverse function is used in the creation of compound index
  6816.       fields. What it actually does is alter the characters of the
  6817.       parameter in such a way that an alphabetic listing of a field
  6818.       after reversal will have the reverse order to that of the
  6819.       original characters before using the reverse function.
  6820.  
  6821.       In the example shown for the function "zeropad", had you wished
  6822.       to list the pupils in descending age order there would be no
  6823.       point in using the procedure code:
  6824.  
  6825.       for pupils with unifield in reverse order
  6826.  
  6827.       as this would not only reverse the age grouping but would also
  6828.       reverse the name order.
  6829.  
  6830.       To produce the desired printout use exactly the same procedure
  6831.       but derive "unifield" as:-
  6832.  
  6833.       Jointext(reverse(zeropad(age,2,0)),name)
  6834.  
  6835.  
  6836.  
  6837.  
  6838.  
  6839.  
  6840.  
  6841.  
  6842.  
  6843.  
  6844.  
  6845.  
  6846.  
  6847.  
  6848.  
  6849.  
  6850.  
  6851.  
  6852.  
  6853.  
  6854.  
  6855.  
  6856.  
  6857.  
  6858.  
  6859.  
  6860.  
  6861.  
  6862.  
  6863.  
  6864.  
  6865.  
  6866.  
  6867.  
  6868.                                 - 117 -
  6869. ................................................................................
  6870.       RIGHTTEXT                  FUNCTION                   RIGHTTEXT
  6871.  
  6872.       This function returns a specified number of characters from the
  6873.       end of a field or variable.
  6874.  
  6875.       Ex    Righttext(name,10)
  6876.  
  6877.  
  6878.       Ex.   Righttext(datetext(system date),4)
  6879.             < returns  1993 , 1994 Etc.>
  6880.  
  6881.  
  6882.       Acceptable parameters:
  6883.  
  6884.       Text field/variable
  6885.       Any function returning a text value
  6886.  
  6887.  
  6888.  
  6889.  
  6890.  
  6891.  
  6892.  
  6893.  
  6894.  
  6895.  
  6896.  
  6897.  
  6898.  
  6899.  
  6900.  
  6901.  
  6902.  
  6903.  
  6904.  
  6905.  
  6906.  
  6907.  
  6908.  
  6909.  
  6910.  
  6911.  
  6912.  
  6913.  
  6914.  
  6915.  
  6916.  
  6917.  
  6918.  
  6919.  
  6920.  
  6921.  
  6922.  
  6923.  
  6924.  
  6925.                                 - 118 -
  6926. ................................................................................
  6927.       ROUND                      FUNCTION                       ROUND
  6928.  
  6929.       There are three rounding functions in Easy base:-
  6930.  
  6931.       Round
  6932.       Roundup
  6933.       Rounddown
  6934.  
  6935.       If a rounding function is called with a single parameter then
  6936.       the return value is the parameter rounded to the nearest
  6937.       integer value.
  6938.  
  6939.       Ex. Round(items/reps)
  6940.          < if items = 9 and reps = 4. 2 is returned >
  6941.  
  6942.       All rounding functions accept a second parameter indicating the
  6943.       number of decimal places (or powers of 10 if negative) to round
  6944.       to.
  6945.  
  6946.       Ex. Rounddown(vaton(net),2)
  6947.          < Rounds down the VAT on field "net" to the nearest penny.
  6948.  
  6949.       Ex. Jointext(roundup(if(mod(years,100) = 0,years+1,years),-2
  6950.           )/100,"th Century")
  6951.  
  6952.         < Returns "20th Century" for all values of years 1900-1999 >
  6953.  
  6954.  
  6955.       Round Produces a default rounding system in which:-
  6956.  
  6957.          2.4 rounds to  2
  6958.          2.5 rounds to  3
  6959.         -2.4 rounds to -2
  6960.         -2.5 rounds to -3
  6961.  
  6962.       In the Roundup and Rounddown functions the direction is sign
  6963.       sensitive:-
  6964.  
  6965.          2.5 roundsup to  3      2.5 roundsdown to  2
  6966.         -2.5 roundsup to -2     -2.5 roundsdown to -3
  6967.  
  6968.       Acceptable parameters:
  6969.  
  6970.       Numeric value
  6971.       Numeric expression
  6972.       Numeric field/variable
  6973.       Any other function which returns a numeric value
  6974.  
  6975.  
  6976.  
  6977.  
  6978.  
  6979.  
  6980.  
  6981.  
  6982.                                 - 119 -
  6983. ................................................................................
  6984.       RUN                      FIELD CONTROL                      RUN
  6985.  
  6986.       The "run" control is used to initiate procedures with input
  6987.       screens without the user having to press F2.
  6988.  
  6989.       Ex.   If(lookup(customers,name) = blank,blank,lookup(customers,
  6990.             name)[run])
  6991.  
  6992.       In the above example, a procedure which lists customers
  6993.       accounts has an input screen with a single field where the
  6994.       customers name is entered. When the user enters a name the
  6995.       above derivation will test whether or not the entered name is a
  6996.       customer. If the entered name does not exist in the customers
  6997.       file the field will be blanked out but if it does then the
  6998.       procedure will run without the user having to press F2.
  6999.  
  7000.  
  7001.  
  7002.  
  7003.  
  7004.  
  7005.  
  7006.  
  7007.  
  7008.  
  7009.  
  7010.  
  7011.  
  7012.  
  7013.  
  7014.  
  7015.  
  7016.  
  7017.  
  7018.  
  7019.  
  7020.  
  7021.  
  7022.  
  7023.  
  7024.  
  7025.  
  7026.  
  7027.  
  7028.  
  7029.  
  7030.  
  7031.  
  7032.  
  7033.  
  7034.  
  7035.  
  7036.  
  7037.  
  7038.  
  7039.                                 - 120 -
  7040. ................................................................................
  7041.       RUN                    PROCEDURE COMMAND                    RUN
  7042.  
  7043.       The "Run" command terminates the current procedure and starts
  7044.       another.
  7045.  
  7046.       The "Run" command can be used to chain procedures similar to
  7047.       placing them on a batch execute menu. Its main use, however, is
  7048.       to branch to other procedures depending on which function key
  7049.       was pressed from the input screen. Procedures can be initiated
  7050.       from their input screens by pressing any of the function keys
  7051.       F2, F4, F5, F7, F8, F9 or F10. The number of the function key
  7052.       which was pressed is returned in the system value "Fun_Key". If
  7053.       the procedure was initiated by the field control [Run] then the
  7054.       Fun_Key value returns 0.
  7055.  
  7056.       Example.
  7057.  
  7058.       If Fun_Key = 7 then Run Import1
  7059.       If Fun_Key = 8 then Run Import2
  7060.       If Fun_key = 2 then
  7061.          for customers with name = input.name
  7062.             print list items
  7063.          next
  7064.       end if
  7065.  
  7066.       If you press F1 after typing "Run" in the procedure code
  7067.       editor, Easy Base will list all your procedure names for you to
  7068.       pick from and ensure correct spelling.
  7069.  
  7070.       The Run command only transfers control to the next procedure
  7071.       when the main procedure is executed from a user menu. When you
  7072.       are developing your procedures in the procedure generator the
  7073.       called procedure cannot be loaded. If the code for a procedure
  7074.       being tested in the procedure generator reaches a "Run"
  7075.       command, the test ends with the message "Run call made to..OK"
  7076.       to let you know that the call will be made when the procedure
  7077.       is run live from a user menu.
  7078.  
  7079.       See also: Fun_Key Disable
  7080.  
  7081.  
  7082.  
  7083.  
  7084.  
  7085.  
  7086.  
  7087.  
  7088.  
  7089.  
  7090.  
  7091.  
  7092.  
  7093.  
  7094.  
  7095.  
  7096.                                 - 121 -
  7097. ................................................................................
  7098.       SCREEN COLOURS             UTILITY               SCREEN COLOURS
  7099.  
  7100.       The "Screen Colours" utility provides 14 pre defined colour
  7101.       sets including two for "Mono Graphics" cards together with a
  7102.       user defined setup. To change the colours of your system simply
  7103.       select "Screen Colours" from the Utilities menu and select the
  7104.       set you want.
  7105.  
  7106.       The "Screen Colours" utility can also be called as a User Menu
  7107.       function allowing an end user to change his screen set from
  7108.       your menus without accessing the system.
  7109.  
  7110.  
  7111.  
  7112.  
  7113.  
  7114.  
  7115.  
  7116.  
  7117.  
  7118.  
  7119.  
  7120.  
  7121.  
  7122.  
  7123.  
  7124.  
  7125.  
  7126.  
  7127.  
  7128.  
  7129.  
  7130.  
  7131.  
  7132.  
  7133.  
  7134.  
  7135.  
  7136.  
  7137.  
  7138.  
  7139.  
  7140.  
  7141.  
  7142.  
  7143.  
  7144.  
  7145.  
  7146.  
  7147.  
  7148.  
  7149.  
  7150.  
  7151.  
  7152.  
  7153.                                 - 122 -
  7154. ................................................................................
  7155.       SECONDS                    FUNCTION                     SECONDS
  7156.  
  7157.       This function returns the seconds number from the time
  7158.       parameter.
  7159.  
  7160.       Ex.    seconds(system time)
  7161.  
  7162.  
  7163.       Acceptable parameters:
  7164.  
  7165.       System time
  7166.       Time field
  7167.       Maketime function
  7168.       Time expression
  7169.  
  7170.  
  7171.  
  7172.  
  7173.  
  7174.  
  7175.  
  7176.  
  7177.  
  7178.  
  7179.  
  7180.  
  7181.  
  7182.  
  7183.  
  7184.  
  7185.  
  7186.  
  7187.  
  7188.  
  7189.  
  7190.  
  7191.  
  7192.  
  7193.  
  7194.  
  7195.  
  7196.  
  7197.  
  7198.  
  7199.  
  7200.  
  7201.  
  7202.  
  7203.  
  7204.  
  7205.  
  7206.  
  7207.  
  7208.  
  7209.  
  7210.                                 - 123 -
  7211. ................................................................................
  7212.       Seek                     File Command                      Seek
  7213.  
  7214.       The "Seek" command moves the Read/Write pointer within a non
  7215.       Easy Base file which has been opened with the "Open" Command.
  7216.       The actual position of the pointer at any time is available in
  7217.       the system value File_Pos. The File_Pos value is the pointers
  7218.       current offset in bytes (Numbering the first byte as 1).
  7219.  
  7220.       The Seek Command accepts an actual offset, an offset relative
  7221.       to File_Pos or File_Len or an ASCII line movement.
  7222.  
  7223.       Examples.
  7224.  
  7225.       Seek 245
  7226.       Seek File_Pos + 35
  7227.       Seek File_Len - 20
  7228.       Seek Line_Forward
  7229.       Seek Line_Back
  7230.  
  7231.       You cannot combine an ASCII line movement with an offset -
  7232.       To read ten bytes starting at byte 30 on the next line you need
  7233.       two Seek commands.
  7234.  
  7235.       Seek Line_Forward
  7236.       Seek File_Pos + 29
  7237.       read 10 to Parts.No
  7238.  
  7239.       The line movement Line_Forward always positions the pointer at
  7240.       the start of the next line.
  7241.  
  7242.       The line movement Line_Back moves the pointer to the start of
  7243.       the current line if it is not already there and to the start of
  7244.       the previous line if it is.
  7245.  
  7246.       Some files (Eg. Email) have a non ASCII header followed by
  7247.       ASCII lines for the actual message. You can use Seek
  7248.       Line_Forward within a Do Loop to skip though the non ASCII
  7249.       part. If Line_Forward does not find a Carriage Return and Line
  7250.       Feed sequence within 255 bytes then it leaves the file pointer
  7251.       255 bytes ahead of its last position. There is no corresponding
  7252.       facility in Line_Back. If Line_Back does not find a line feed
  7253.       (or Start of File) within 255 bytes then the file pointer does
  7254.       not move.
  7255.  
  7256.       See also: Open, Close, Read, Write, Find, Erase
  7257.  
  7258.  
  7259.  
  7260.  
  7261.  
  7262.  
  7263.  
  7264.  
  7265.  
  7266.  
  7267.                                 - 124 -
  7268. ................................................................................
  7269.       SEQUENCE                 SYSTEM VALUE                  SEQUENCE
  7270.  
  7271.       When you create a new form a sequence value is updated each
  7272.       time a record is entered. The "sequence" value starts at 1 and
  7273.       continues to 2 billion irrespective of whether or not records
  7274.       have been deleted from the form. If you derive a field as
  7275.       "sequence" then each new record will have the next sequenced
  7276.       number. Sequence derivations are useful for such things as
  7277.       invoice numbers.
  7278.  
  7279.       A sequence field need not start at one however.
  7280.  
  7281.       Ex.  sequence + 1000 would number the first record 1001
  7282.  
  7283.       The sequence number for any form can be reset in procedure
  7284.       code.
  7285.  
  7286.       For Form
  7287.          Form.Sequence = 1
  7288.          Reset Sequence
  7289.          exit for
  7290.       next
  7291.  
  7292.  
  7293.  
  7294.  
  7295.  
  7296.  
  7297.  
  7298.  
  7299.  
  7300.  
  7301.  
  7302.  
  7303.  
  7304.  
  7305.  
  7306.  
  7307.  
  7308.  
  7309.  
  7310.  
  7311.  
  7312.  
  7313.  
  7314.  
  7315.  
  7316.  
  7317.  
  7318.  
  7319.  
  7320.  
  7321.  
  7322.  
  7323.  
  7324.                                 - 125 -
  7325. ................................................................................
  7326.       SET PAPER LENGTH           UTILITY             SET PAPER LENGTH
  7327.  
  7328.       The "Set Paper Length" utility is accessed from the
  7329.       Utilities menu and can also be called from a user menu.
  7330.  
  7331.       There are settings for A3, A4, A5, American Letter and
  7332.       American Legal in both portrait and landscape.
  7333.  
  7334.       When you change the paper length in use then you update
  7335.       pagination for all report outputs.
  7336.  
  7337.       The landscape options are for use in wide carriage printers
  7338.       where the paper can be fed in landscape orientation they do not
  7339.       produce "sideways" printing on narrow carriage printers.
  7340.  
  7341.       If the paper size you use is not one of those listed, select
  7342.       "Other" and you can enter the length and width of your paper
  7343.       manually.
  7344.  
  7345.       The Length is entered in "Lines" ( One Sixths of an inch ) and
  7346.       the width is entered in inches.
  7347.  
  7348.       For example, if your paper is 12 inches by 8.25 inches you
  7349.       would enter the length as 72 and the width as 8.25.
  7350.  
  7351.  
  7352.  
  7353.  
  7354.  
  7355.  
  7356.  
  7357.  
  7358.  
  7359.  
  7360.  
  7361.  
  7362.  
  7363.  
  7364.  
  7365.  
  7366.  
  7367.  
  7368.  
  7369.  
  7370.  
  7371.  
  7372.  
  7373.  
  7374.  
  7375.  
  7376.  
  7377.  
  7378.  
  7379.  
  7380.  
  7381.                                 - 126 -
  7382. ................................................................................
  7383.       Shell                    File Command                     Shell
  7384.  
  7385.       The "Shell" command executes a DOS command which you supply as
  7386.       the parameter.
  7387.  
  7388.       Shell "DIR C:\WP > C:\EB\DIR.TXT"
  7389.  
  7390.       This writes a directory listing of C:\WP to the file DIR.TXT
  7391.       which you can then open and read from.
  7392.  
  7393.       You can supply the parameter as quoted text, as a variable or
  7394.       field or with a function.
  7395.  
  7396.       Shell Jointext("copy C:\PROGS\",input.directory,"\*.* A:\")
  7397.  
  7398.       In this example a disk vendor can select programs by name on an
  7399.       input screen which looks up the directory in which the program
  7400.       is stored. The procedure then copies all files from that
  7401.       directory to the A: drive.
  7402.  
  7403.       Depending on the procedure you are running, Easy Base uses
  7404.       between 450K and 550K of base memory. You cannot therefore
  7405.       "Shell" to any major program. The main use of "Shell" is to use
  7406.       the DOS copy and Dir commands. You can also shell to a batch
  7407.       file of such commands if you have several tasks to perform.
  7408.  
  7409.       CAUTION
  7410.  
  7411.       The Easy Base Executable file expects to find its support files
  7412.       in the current default directory. If you change drive or
  7413.       directory while shelled out of Easy Base then you must change
  7414.       back before exiting the procedure.
  7415.  
  7416.       If you are writing an application for resale then remember that
  7417.       the end user might not have installed it to C:\EB. Change back
  7418.       to the correct drive and directory by using the system value
  7419.       "Prog_Dir".
  7420.  
  7421.       Declare variables
  7422.          Drive as text : Dir as text
  7423.       end
  7424.       drive = lefttext(prog_dir,2)
  7425.       dir = righttext(prog_dir,lengthtext(prog_dir)-3)
  7426.       shell "Job.Bat"
  7427.       shell drive
  7428.       shell jointext("CD\",dir)
  7429.  
  7430.       When you use "Shell" Easy Base clears the screen and pauses for
  7431.       any DOS error messages. If you know that the command you are
  7432.       about to shell to will not invoke a response from DOS you can
  7433.       add the keyword "Smooth" and Easy Base will not clear the
  7434.       screen or pause.
  7435.  
  7436.       Shell Smooth "DIR C:\FAX > C:\EB\DIR.TXT"
  7437.  
  7438.                                 - 127 -
  7439. ................................................................................
  7440.       Show PickList          PROCEDURE COMMAND          Show PickList
  7441.  
  7442.       In most instances where you select records for displaying,
  7443.       printing or further processing you will be able to select based
  7444.       on a group field or a range of field values. There will however
  7445.       be occasions where you need to select a set of records which
  7446.       are totally unrelated. To do this Easy Base includes a pre
  7447.       defined system form called "PickList". This form has two fields
  7448.       called "Item" and "Mark".  The PickList form is only accessible
  7449.       within procedures. You can process it just like one of your own
  7450.       forms (Except that you cannot "Create Temp as PickList") and
  7451.       you can display it at any point in a procedure with the command
  7452.       "Show PickList". The difference between PickList and any other
  7453.       form is that it displays as a table. The Item field is no entry
  7454.       and the Mark field is a choice field which is either Blank or
  7455.       ASCII 251 ( √ ). After displaying the form you can continue
  7456.       your processing based on the value of the "Mark" field.
  7457.  
  7458.       As an example of the use of the picklist form, suppose that you
  7459.       had a contacts form with names and addresses. There is also a
  7460.       group field which is either Customer, Supplier, or Employee
  7461.       You want to send a circular letter to your Customers - but not
  7462.       all of them - only the ones you know personally. There is no
  7463.       sub grouping for this - you need to actually "Tick off" the
  7464.       ones you require from a list.
  7465.       ..........................................
  7466.       Declare output fields
  7467.          Contacts.Name : Contacts.address : date
  7468.       End
  7469.       For Contacts with Group = "Customer"
  7470.          For PickList new record
  7471.             Picklist.Item = Contacts.Name
  7472.          Next
  7473.       Next
  7474.       Show PickList
  7475.       For Picklist with Mark = Chr$(251)
  7476.          For Contacts with name = Picklist.Item
  7477.             Print Letter
  7478.          Next
  7479.       Next
  7480.       Clear Records from PickList
  7481.       ............................................
  7482.       At the line "Show Picklist" Easy Base will display all your
  7483.       customers names in a table which you can scroll through
  7484.       marking or unmarking the customers to which you wish to print
  7485.       the circular. When you Escape from the PickList form,
  7486.       processing continues in the procedure code, printing the Letter
  7487.       only to those customers which you have "Ticked" ie with the
  7488.       "Mark" field = Chr$(251).
  7489.  
  7490.       PickList is not a temporary form. You can add or delete records
  7491.       in one procedure and show it in another. You must clear records
  7492.       from one usage before the next.
  7493.       Cont.
  7494.  
  7495.                                 - 128 -
  7496. ................................................................................
  7497.       Show PickList          PROCEDURE COMMAND          Show PickList
  7498.  
  7499.       The Item field in Picklist is a text field 80 characters in
  7500.       length. You can show from 1 to 65 characters of this field by
  7501.       stating the length after the command "Show PickList 20" If you
  7502.       do not enter a length the default is 35. There is no problem
  7503.       allocating numeric values to PickList.Item but you cannot show
  7504.       a Time field. You cannot show a date field directly but you can
  7505.       use Picklist for dates if you have a field with the date shown
  7506.       in text derived with the datetext function.
  7507.  
  7508.       For Events with Type = "Committee Meeting"
  7509.          For PickList new record
  7510.             Picklist.Item = Events.Dateastext
  7511.             PickList.Mark = Chr$(251)
  7512.          next
  7513.       Next
  7514.       Show PickList 18
  7515.  
  7516.       In the above example you will see that the "Mark" field is also
  7517.       pre filled. In this case, when the list displays, all the dates
  7518.       will be pre marked.
  7519.  
  7520.       The following keys are active when PickList is displayed.
  7521.  
  7522.       Up Down PgUp PgDn Home End
  7523.  
  7524.       Space     Marks or unmarks individual items
  7525.  
  7526.       F4        Marks or unmarks all items
  7527.  
  7528.       F5        Swaps marked for unmarked
  7529.  
  7530.       F10       Makes a shortlist of marked items only
  7531.  
  7532.       F2        Returns to the procedure code.
  7533.  
  7534.  
  7535.  
  7536.  
  7537.  
  7538.  
  7539.  
  7540.  
  7541.  
  7542.  
  7543.  
  7544.  
  7545.  
  7546.  
  7547.  
  7548.  
  7549.  
  7550.  
  7551.  
  7552.                                 - 129 -
  7553. ................................................................................
  7554.       SKIP GROUP             PROCEDURE COMMAND             SKIP GROUP
  7555.  
  7556.       The "Skip Group" command excludes an entire group of records
  7557.       from selection by a "For" loop.
  7558.  
  7559.       Ex.
  7560.  
  7561.       for employees with type in order
  7562.          if employees.type = "Part time" then skip group
  7563.          print list items
  7564.       next
  7565.  
  7566.       The "Skip Group" command is not the same as filtering with a
  7567.       "<>" condition.  You could achieve the same result with :-
  7568.  
  7569.       for employees with type in order
  7570.          if employees.type <> "Part time" then
  7571.             print list items
  7572.          end if
  7573.       next
  7574.  
  7575.       but the second procedure would take much longer to run as each
  7576.       part time employee's record would be loaded into memory only to
  7577.       be rejected by the "If" condition.  The first procedure on the
  7578.       other hand only loads a single part time employee's record then
  7579.       skips the entire group by advancing the index pointer in use
  7580.       for record selection.
  7581.  
  7582.       You can also use the "Skip Group" command to terminate
  7583.       selection of a group of records at a given point.
  7584.  
  7585.       declare variables
  7586.          count as number
  7587.       end
  7588.       for employees with type in order
  7589.          count = count + 1
  7590.          if count = 51 then
  7591.             count = 0
  7592.             skip group
  7593.          end if
  7594.          print list items
  7595.       next
  7596.  
  7597.       The above procedure prints the first fifty employees in each
  7598.       "type" group.
  7599.  
  7600.       The "Skip Group" command can be shortened to "Skipgrp"
  7601.  
  7602.       IMPORTANT: The condition for the Skip Group cannot be nested
  7603.       within another "If" condition or "DO LOOP" structure which is
  7604.       itself within the current "For" loop.
  7605.  
  7606.       :- See Skip Record for example.
  7607.  
  7608.  
  7609.                                 - 130 -
  7610. ................................................................................
  7611.       SKIP RECORD            PROCEDURE COMMAND            SKIP RECORD
  7612.  
  7613.       The "Skip Record" command is used to exclude individual records
  7614.       from selection in a "For" Loop.
  7615.  
  7616.       Ex.
  7617.  
  7618.       for employee with worksno in order
  7619.          if employees.worksno = 12 then skip record
  7620.          print list items
  7621.       next
  7622.  
  7623.       The "Skip Record" command has exactly the same effect as
  7624.       filtering with a "<>" condition but is much easier to write if
  7625.       there are many items to exclude
  7626.  
  7627.       for employees with worksno in order
  7628.          if employees.worksno = 12 or employees.worksno = 15 then
  7629.             skip record
  7630.          end if
  7631.          if employees.name = "smith" then skip record
  7632.          if employees.age > 50 then skip record
  7633.       next
  7634.  
  7635.       You can exclude groups of records from an inner loop by
  7636.       applying the "Skip Record" command to a "Unique" outer loop.
  7637.  
  7638.       for employees alias types with type in order unique
  7639.          if types.type = "director" then skip record
  7640.          if types.type = "part time" then skip record
  7641.          for employees with type = types.type
  7642.             print list items
  7643.          next
  7644.       next
  7645.  
  7646.       If you need to exclude groups of records from a single loop you
  7647.       must use the "Skip Group" command.
  7648.  
  7649.       The "Skip Record" command can be shortened to "Skiprec".
  7650.  
  7651.       IMPORTANT:
  7652.  
  7653.       The Skip Record command causes a direct jump to the start of
  7654.       the next iteration of the current "For" loop. The condition
  7655.       for the Skip Record must not be nested within another "If"
  7656.       condition or "Do Loop" structure which is itself within the
  7657.       current For loop.
  7658.  
  7659.       for form
  7660.          if (condition) then
  7661.             if form.type = "Part time" then skip record
  7662.          end if
  7663.       next
  7664.                    This will cause a system error.
  7665.  
  7666.                                 - 131 -
  7667. ................................................................................
  7668.       SPACEPAD                   FUNCTION                    SPACEPAD
  7669.  
  7670.       The Spacepad function pads a text variable to a given length
  7671.       with spaces.
  7672.  
  7673.       Ex.   Spacepad(name,10)
  7674.             < returns "Fred      " if name = "Fred"
  7675.  
  7676.       The spacepad function is used in the creation of compound index
  7677.       fields.
  7678.  
  7679.       For example:    A "Films" form has the fields "title" and
  7680.       "category". To list the films grouped by category in order and
  7681.       with the titles in each category in order create the field
  7682.       "groupindex" as text,long enough to hold both category and
  7683.       title fields and derived as :-
  7684.  
  7685.       Jointext(spacepad(category,15),title)
  7686.                       {15 is length of category field}
  7687.  
  7688.       You can then produce the required printout with the following
  7689.  
  7690.       procedure.
  7691.  
  7692.       ....................format.........................
  7693.  
  7694.       .Report header
  7695.         ═══════════════════════════════════════════════════════════
  7696.                        FILM LIST BY CATEGORY
  7697.         ═══════════════════════════════════════════════════════════
  7698.       .Group header
  7699.         Films in {category field}
  7700.       .List items
  7701.        {title field} Starring {Star field} Running time {length Fld}
  7702.       .end
  7703.  
  7704.       ......................procedure code.................
  7705.       declare output fields
  7706.          films.title:films.star:films.length:films.category
  7707.       end
  7708.       declare variables
  7709.          catcheck as text
  7710.       end
  7711.       '............
  7712.       bold on
  7713.       print report header
  7714.       for films with groupindex in order
  7715.          if films.category <> catcheck then
  7716.             bold on
  7717.             print group header
  7718.             bold off
  7719.          end if
  7720.          print list items
  7721.       next
  7722.  
  7723.                                 - 132 -
  7724. ................................................................................
  7725.       SPELLDAY                   FUNCTION                    SPELLDAY
  7726.  
  7727.       This function spells out the day of the number (1-7) parameter.
  7728.  
  7729.       Ex.   Spellday(dayofweek(system date))
  7730.  
  7731.  
  7732.       Acceptable parameters:
  7733.  
  7734.       Numeric value                              (1-7)
  7735.       Numeric expression evaluating to           (1-7)
  7736.       Numeric Field/variable holding value       (1-7)
  7737.       Any function returning a numeric value     (1-7)
  7738.  
  7739.  
  7740.  
  7741.  
  7742.  
  7743.  
  7744.  
  7745.  
  7746.  
  7747.  
  7748.  
  7749.  
  7750.  
  7751.  
  7752.  
  7753.  
  7754.  
  7755.  
  7756.  
  7757.  
  7758.  
  7759.  
  7760.  
  7761.  
  7762.  
  7763.  
  7764.  
  7765.  
  7766.  
  7767.  
  7768.  
  7769.  
  7770.  
  7771.  
  7772.  
  7773.  
  7774.  
  7775.  
  7776.  
  7777.  
  7778.  
  7779.  
  7780.                                 - 133 -
  7781. ................................................................................
  7782.       SPELLMONTH                 FUNCTION                  SPELLMONTH
  7783.  
  7784.       This function spells out the day of the number (1-12)
  7785.       parameter.
  7786.  
  7787.  
  7788.       Ex.   Spellmonth(month(system date))
  7789.  
  7790.       Ex.   Month = Spellmonth(month(invoices.date))
  7791.  
  7792.  
  7793.       Acceptable parameters:
  7794.  
  7795.       Numeric value                           (1-12)
  7796.       Numeric expression evaluating to        (1-12)
  7797.       Numeric Field/variable holding value    (1-12)
  7798.       Any function returning a numeric value  (1-12)
  7799.  
  7800.  
  7801.  
  7802.  
  7803.  
  7804.  
  7805.  
  7806.  
  7807.  
  7808.  
  7809.  
  7810.  
  7811.  
  7812.  
  7813.  
  7814.  
  7815.  
  7816.  
  7817.  
  7818.  
  7819.  
  7820.  
  7821.  
  7822.  
  7823.  
  7824.  
  7825.  
  7826.  
  7827.  
  7828.  
  7829.  
  7830.  
  7831.  
  7832.  
  7833.  
  7834.  
  7835.  
  7836.  
  7837.                                 - 134 -
  7838. ................................................................................
  7839.       START HERE             DERIVATION PREFIX             START HERE
  7840.  
  7841.       If, in a form or procedure input screen, you want the cursor to
  7842.       start in other than the top left field then derive the field in
  7843.       which you wish the cursor to start with "Start here" .
  7844.  
  7845.       If the field in which the cursor is to start already has a
  7846.       derivation then simply prefix the derivation with "Start here".
  7847.  
  7848.       Ex.
  7849.  
  7850.       start here Lookup(customers,name)
  7851.  
  7852.  
  7853.  
  7854.       1. You can have more than one prefix on any one field
  7855.          derivation provided there is a space between each.
  7856.  
  7857.  
  7858.  
  7859.  
  7860.  
  7861.  
  7862.  
  7863.  
  7864.  
  7865.  
  7866.  
  7867.  
  7868.  
  7869.  
  7870.  
  7871.  
  7872.  
  7873.  
  7874.  
  7875.  
  7876.  
  7877.  
  7878.  
  7879.  
  7880.  
  7881.  
  7882.  
  7883.  
  7884.  
  7885.  
  7886.  
  7887.  
  7888.  
  7889.  
  7890.  
  7891.  
  7892.  
  7893.  
  7894.                                 - 135 -
  7895. ................................................................................
  7896.       STRINGOF                   FUNCTION                    STRINGOF
  7897.  
  7898.       This function returns a string of characters.
  7899.  
  7900.       Ex.   Stringof(12,"-")
  7901.              < Returns "------------">
  7902.  
  7903.  
  7904.       Ex.  Stringof(5,chr$(240))
  7905.             < Returns "≡≡≡≡≡">
  7906.  
  7907.  
  7908.       One of the most useful applications of the "Stringof" function
  7909.       is to pad output fields in tabular reports with "." characters.
  7910.  
  7911.       Ex.
  7912.  
  7913.       Declare output fields
  7914.          stock.name : stock.price
  7915.       end
  7916.       for stock with name in order
  7917.          stock.name = jointext(stock.name,stringof(30-lengthtext(
  7918.                       stock.name),".")
  7919.          print list items
  7920.       next
  7921.  
  7922.  
  7923.       The printed output from the above report would be in the form:-
  7924.  
  7925.             Gizmo.........................  2.50
  7926.             Sprocket......................  9.95
  7927.             Widget........................  3.10
  7928.  
  7929.  
  7930.  
  7931.       Acceptable parameters:
  7932.  
  7933.       1   Any numeric field, variable, expression or function
  7934.       2   Single quoted character - Function returning a single
  7935.           character
  7936.  
  7937.  
  7938.  
  7939.  
  7940.  
  7941.  
  7942.  
  7943.  
  7944.  
  7945.  
  7946.  
  7947.  
  7948.  
  7949.  
  7950.  
  7951.                                 - 136 -
  7952. ................................................................................
  7953.       SUBINDEX               PROCEDURE COMMAND               SUBINDEX
  7954.  
  7955.       The command Subindex is used to create an index file which
  7956.       contains only a subset of the records in a form.
  7957.  
  7958.       Subset indices are used in reports to output records in the
  7959.       order of one field when they have been selected using the index
  7960.       file on another field. For example, if you wish to list all the
  7961.       employees who work at the "Manchester" branch with their
  7962.       surnames in order you need to select the records using the
  7963.       index on the "Branch" field but you need to list them using an
  7964.       index on the "Surname" field. Since you can only use one index
  7965.       at a time you need to create an index on "Surname" which only
  7966.       contains the records which have "Manchester" as the branch.
  7967.  
  7968.       For Employees with branch = "Manchester"
  7969.          Subindex surname as #1
  7970.       next
  7971.       for Employees with subindex 1 in order
  7972.          print list items
  7973.       next
  7974.  
  7975.       You can have up to nine subset indices in any one procedure and
  7976.       you can select subsets from subsets. For example, if, in the
  7977.       employees list you only wished to list female employees whose
  7978.       salary was greater than 50,000 you would use:-
  7979.  
  7980.       For Employees with branch = "Manchester"
  7981.          Subindex sex as #1
  7982.       next
  7983.       For Employees with subindex 1 = "Female"
  7984.          Subindex salary as #2
  7985.       next
  7986.       For Employees with subindex 2 > 50000
  7987.          Subindex surname as #3
  7988.       next
  7989.       for Employees with subindex 3 in order
  7990.          Print List Items
  7991.       next
  7992.  
  7993.       Subset indices are temporary files. You cannot use a subset
  7994.       index in one procedure that was created in another.
  7995.  
  7996.       Within one procedure, however, you can use a subset index
  7997.       almost as if it were a form. You can add records to it as often
  7998.       as you wish before using it and you can erase its contents with
  7999.       the "Clear records from" command.
  8000.  
  8001.       Clear records from subindex 1
  8002.  
  8003.       This allows you to build subsets with multiple selections eg.
  8004.       Employees with branch = "Manchester" or branch = "Birmingham"
  8005.       and to reuse a subset index in a nested loop eg. Employees
  8006.       grouped by branch in surname order.
  8007.  
  8008.                                 - 137 -
  8009. ................................................................................
  8010.       SUBINDEX               PROCEDURE COMMAND               SUBINDEX
  8011.  
  8012.       Example of multiple selections:
  8013.  
  8014.       For Employees with branch = "Manchester"
  8015.          Subindex surname as #1
  8016.       next
  8017.       For Employees with branch = "Birmingham"
  8018.          Subindex surname as #1
  8019.       next
  8020.       For Employees with subindex 1 in order
  8021.          Print List Items
  8022.       next
  8023.  
  8024.       Example of nested subset:
  8025.  
  8026.       For Branches with name in order
  8027.          Print group header
  8028.          For Employees with branch = branches.name
  8029.             Subindex surname as #1
  8030.          next
  8031.          For Employees with subindex 1 in order
  8032.             Print List Items
  8033.          next
  8034.          Print group footer
  8035.          Clear records from subindex 1
  8036.       next
  8037.  
  8038.       In the first example, the records with branch = "Birmingham"
  8039.       are added to those with branch = "Manchester" and both are
  8040.       listed as a single subset.
  8041.  
  8042.       In the second example each individual branch subset is printed
  8043.       and then erased ready for the next.
  8044.  
  8045.       Whenever Easy Base is writing to a subset index the "Running"
  8046.       flash on the upper status line is replaced with "Sorting".
  8047.  
  8048.  
  8049.  
  8050.  
  8051.  
  8052.  
  8053.  
  8054.  
  8055.  
  8056.  
  8057.  
  8058.  
  8059.  
  8060.  
  8061.  
  8062.  
  8063.  
  8064.  
  8065.                                 - 138 -
  8066. ................................................................................
  8067.       SYSTEM DATE              SYSTEM VALUE               SYSTEM DATE
  8068.  
  8069.       You can use your computers inbuilt date anywhere in field
  8070.       derivations or procedure code by simply quoting "system date".
  8071.  
  8072.       Ex.
  8073.  
  8074.       for diary with date = system date
  8075.          print list items
  8076.       next
  8077.  
  8078.  
  8079.  
  8080.  
  8081.  
  8082.  
  8083.  
  8084.  
  8085.  
  8086.  
  8087.  
  8088.  
  8089.  
  8090.  
  8091.  
  8092.  
  8093.  
  8094.  
  8095.  
  8096.  
  8097.  
  8098.  
  8099.  
  8100.  
  8101.  
  8102.  
  8103.  
  8104.  
  8105.  
  8106.  
  8107.  
  8108.  
  8109.  
  8110.  
  8111.  
  8112.  
  8113.  
  8114.  
  8115.  
  8116.  
  8117.  
  8118.  
  8119.  
  8120.  
  8121.  
  8122.                                 - 139 -
  8123. ................................................................................
  8124.       SYSTEM TIME              SYSTEM VALUE               SYSTEM TIME
  8125.  
  8126.       You can use your computers inbuilt time anywhere in field
  8127.       derivations or procedure code by simply quoting "system time".
  8128.  
  8129.       Ex.
  8130.  
  8131.       for stockitems with stockno = input.stockno
  8132.          lastcheckeddate = system date
  8133.          lastcheckedtime = system time
  8134.          update record
  8135.       next
  8136.  
  8137.  
  8138.  
  8139.  
  8140.  
  8141.  
  8142.  
  8143.  
  8144.  
  8145.  
  8146.  
  8147.  
  8148.  
  8149.  
  8150.  
  8151.  
  8152.  
  8153.  
  8154.  
  8155.  
  8156.  
  8157.  
  8158.  
  8159.  
  8160.  
  8161.  
  8162.  
  8163.  
  8164.  
  8165.  
  8166.  
  8167.  
  8168.  
  8169.  
  8170.  
  8171.  
  8172.  
  8173.  
  8174.  
  8175.  
  8176.  
  8177.  
  8178.  
  8179.                                 - 140 -
  8180. ................................................................................
  8181.       TEXT                      FIELD TYPE                       TEXT
  8182.  
  8183.       The text field type can be up to 80 characters long.
  8184.  
  8185.       Cut copy and paste operations are available between all text,
  8186.       and textblock fields :
  8187.  
  8188.       Use Shift plus the arrow keys to mark the text you wish to cut
  8189.       or copy. When you release the keys the cut or copy choice will
  8190.       appear.
  8191.  
  8192.       To paste cut text position the cursor where you want it
  8193.       inserted and press Shift plus Ins.
  8194.  
  8195.       Spell Checking is also available in text fields -
  8196.          Press Ctrl + S
  8197.  
  8198.  
  8199.  
  8200.  
  8201.  
  8202.  
  8203.  
  8204.  
  8205.  
  8206.  
  8207.  
  8208.  
  8209.  
  8210.  
  8211.  
  8212.  
  8213.  
  8214.  
  8215.  
  8216.  
  8217.  
  8218.  
  8219.  
  8220.  
  8221.  
  8222.  
  8223.  
  8224.  
  8225.  
  8226.  
  8227.  
  8228.  
  8229.  
  8230.  
  8231.  
  8232.  
  8233.  
  8234.  
  8235.  
  8236.                                 - 141 -
  8237. ................................................................................
  8238.       TEXT BLOCK                FIELD TYPE                 TEXT BLOCK
  8239.  
  8240.       When you Define a field with the field type "Text Block" then
  8241.       instead of entering a field length you shade out the area which
  8242.       you wish the field to cover using the arrow keys.
  8243.  
  8244.       Textblock fields offer many of the facilities of a
  8245.       wordprocessor including cut and paste, wordwrap and spell
  8246.       checking.
  8247.  
  8248.       Useful widths for A4 and Letter size paper are 63 characters if
  8249.       you intend to print at 10 characters per inch and 75 characters
  8250.       if you intend to print at 12 characters per inch. This document
  8251.       for instance was created in 63 character wide text blocks.
  8252.  
  8253.       The maximum width of a text block field on screen is 80
  8254.       characters. You can however redefine it up to 230 characters
  8255.       wide in procedure printouts and Easy Base will reformat your
  8256.       paragraphs to the new width.
  8257.  
  8258.       A text block field is not a "memo" field. It can be indexed and
  8259.       derived.
  8260.  
  8261.  
  8262.  
  8263.  
  8264.  
  8265.  
  8266.  
  8267.  
  8268.  
  8269.  
  8270.  
  8271.  
  8272.  
  8273.  
  8274.  
  8275.  
  8276.  
  8277.  
  8278.  
  8279.  
  8280.  
  8281.  
  8282.  
  8283.  
  8284.  
  8285.  
  8286.  
  8287.  
  8288.  
  8289.  
  8290.  
  8291.  
  8292.  
  8293.                                 - 142 -
  8294. ................................................................................
  8295.       TIME                      FIELD TYPE                       TIME
  8296.  
  8297.       The Easy Base "time" field has the eight character format:-
  8298.  
  8299.       11:20:20    (Hours:Minutes:Seconds)
  8300.  
  8301.       You can record time data in any format you wish by using a
  8302.       "Formatted Text" field but you must use a "Time" field if you
  8303.       wish to perform addition and subtraction operations on time
  8304.       values.  (in seconds)
  8305.  
  8306.       Time fields are automatically checked for validity.
  8307.  
  8308.  
  8309.       See Also:-  Maketime
  8310.  
  8311.  
  8312.  
  8313.  
  8314.  
  8315.  
  8316.  
  8317.  
  8318.  
  8319.  
  8320.  
  8321.  
  8322.  
  8323.  
  8324.  
  8325.  
  8326.  
  8327.  
  8328.  
  8329.  
  8330.  
  8331.  
  8332.  
  8333.  
  8334.  
  8335.  
  8336.  
  8337.  
  8338.  
  8339.  
  8340.  
  8341.  
  8342.  
  8343.  
  8344.  
  8345.  
  8346.  
  8347.  
  8348.  
  8349.  
  8350.                                 - 143 -
  8351. ................................................................................
  8352.       TIMEAMPM                   FUNCTION                    TIMEAMPM
  8353.  
  8354.       This function returns the hour ( 0 - 12) plus am. or pm. from
  8355.       the time field parameter.
  8356.  
  8357.       Ex. Timeampm(system time)
  8358.  
  8359.       Ex.
  8360.       -------------------------format----------------------------
  8361.       .Report header
  8362.                      Appointments for {Apps.Date Field}
  8363.       .List items
  8364.                 {Apps.Name Field      }   at  {Time Field}
  8365.       .End
  8366.       -------------------------code----------------------------
  8367.       declare output fields
  8368.          Apps.name
  8369.          Apps.date
  8370.          Time
  8371.       end
  8372.       print report header
  8373.       for apps with date = system date
  8374.          time = timeampm(apps.time)
  8375.          print list items
  8376.       next
  8377.  
  8378.  
  8379.       Acceptable parameters:
  8380.  
  8381.       System time
  8382.       Time field
  8383.       Maketime function
  8384.       Time expression
  8385.  
  8386.  
  8387.  
  8388.  
  8389.  
  8390.  
  8391.  
  8392.  
  8393.  
  8394.  
  8395.  
  8396.  
  8397.  
  8398.  
  8399.  
  8400.  
  8401.  
  8402.  
  8403.  
  8404.  
  8405.  
  8406.  
  8407.                                 - 144 -
  8408. ................................................................................
  8409.       TOTAL COPIES             SYSTEM VALUE              TOTAL COPIES
  8410.  
  8411.       Whenever a procedure enters a "FOR" loop qualified by "With
  8412.       fieldname = " the total number of records which match the
  8413.       qualification value is available in the system value
  8414.       "Total Copies"
  8415.  
  8416.       Total Copies is extracted directly from the index file and
  8417.       relieves you of a time consuming loop all the way through a
  8418.       form updating a counter.
  8419.  
  8420.       In other words:-
  8421.  
  8422.       for books with category = "fiction"
  8423.          count = count + 1
  8424.       next
  8425.  
  8426.       can be replaced with:-
  8427.  
  8428.       for books with category = "fiction"
  8429.          count = total copies
  8430.          exit for
  8431.       next
  8432.  
  8433.       Unlike "Total Records" the "Total Copies" value never includes
  8434.       records marked for deletion.
  8435.  
  8436.       NETWORK VERSIONS
  8437.  
  8438.       With the release of Network V1 the Total Copies system value
  8439.       has been replaced with a pseudo field Form.Total Copies.
  8440.  
  8441.  
  8442.  
  8443.  
  8444.  
  8445.  
  8446.  
  8447.  
  8448.  
  8449.  
  8450.  
  8451.  
  8452.  
  8453.  
  8454.  
  8455.  
  8456.  
  8457.  
  8458.  
  8459.  
  8460.  
  8461.  
  8462.  
  8463.  
  8464.                                 - 145 -
  8465. ................................................................................
  8466.       TOTAL RECORDS            SYSTEM VALUE             TOTAL RECORDS
  8467.  
  8468.       Whenever a procedure enters a "FOR" loop the total number of
  8469.       records in the form is available in the system value
  8470.       "Total records"
  8471.  
  8472.       Ex.
  8473.       The following code fragment updates a "Customer summary" form
  8474.       with the total number of customers in the "Customers" form.
  8475.  
  8476.       declare variables
  8477.         tot as number
  8478.       end
  8479.       for customers with acno = 1
  8480.          tot = total records
  8481.          exit for
  8482.       next
  8483.       for customersummary
  8484.          customersummary.totalcustomers = tot
  8485.          update record
  8486.       next
  8487.  
  8488.       Caution.
  8489.  
  8490.       Provided that the "For" loop is qualified by a "with" statement
  8491.       then the "Total Records" value is extracted directly from the
  8492.       open index file and is the total number of "Live Records".
  8493.  
  8494.       If you access the "Total records" value in an unqualified "For"
  8495.       loop then there is no index file open and the "Total Records"
  8496.       value is derived by dividing the forms file length by the
  8497.       record length. It therefore represents the total number of
  8498.       records in the form "Live" and "Deleted".
  8499.  
  8500.       NETWORK VERSIONS
  8501.  
  8502.       From the release of Network V1 the Total records value has been
  8503.       replaced by a pseudo field Form.Total Records.
  8504.  
  8505.       for customers with acno = 1
  8506.          for customersummary
  8507.             customersummary.totalcustomers = customers.total records
  8508.          next
  8509.          exit for
  8510.       next
  8511.  
  8512.  
  8513.  
  8514.  
  8515.  
  8516.  
  8517.  
  8518.  
  8519.  
  8520.  
  8521.                                 - 146 -
  8522. ................................................................................
  8523.       UPDATE RECORD          PROCEDURE COMMAND          UPDATE RECORD
  8524.  
  8525.       The "Update record" command is used to alter the contents of
  8526.       one or many records in a form.
  8527.  
  8528.       Ex.
  8529.  
  8530.       for stock with item = input.item
  8531.          stock.price = input.price
  8532.          stock.pricechangedate = system date
  8533.          update record
  8534.       next
  8535.  
  8536.       This example changes the price of a single "Stock" item.
  8537.  
  8538.  
  8539.       for employees with taxcode = input.oldtaxcode
  8540.          employees.taxcode = input.newtaxcode
  8541.          update record
  8542.       next
  8543.  
  8544.       This example changes the taxcode field of all the employees
  8545.       whose present taxcode is the same as the input screen
  8546.       "oldtaxcode" to the input screen "newtaxcode".
  8547.  
  8548.  
  8549.       for employees
  8550.          employees.taxcode = employees.taxcode + 60
  8551.          update record
  8552.       next
  8553.  
  8554.       This example increases the taxcode of all employees by sixty.
  8555.  
  8556.  
  8557.  
  8558.  
  8559.  
  8560.  
  8561.  
  8562.  
  8563.  
  8564.  
  8565.  
  8566.  
  8567.  
  8568.  
  8569.  
  8570.  
  8571.  
  8572.  
  8573.  
  8574.  
  8575.  
  8576.  
  8577.  
  8578.                                 - 147 -
  8579. ................................................................................
  8580.       UPPER                      FUNCTION                       UPPER
  8581.  
  8582.       Returns the Uppercase of a text field or variable.
  8583.  
  8584.       Ex.  Upper(postcode)
  8585.            < shows the postcode field in uppercase>
  8586.  
  8587.       Ex.
  8588.       '.......................
  8589.       declare output fields
  8590.          labelname
  8591.          labeladdress
  8592.          labelcode
  8593.       end
  8594.       for customers with maillist = "yes"
  8595.          Labelname = Upper(customers.name)
  8596.          Labeladdress = Upper(customers.address)
  8597.          Labelcode = customers.postcode
  8598.          print labels
  8599.       next
  8600.  
  8601.       Acceptable parameters:
  8602.  
  8603.       Quoted text
  8604.       Text field/variable
  8605.  
  8606.  
  8607.  
  8608.  
  8609.  
  8610.  
  8611.  
  8612.  
  8613.  
  8614.  
  8615.  
  8616.  
  8617.  
  8618.  
  8619.  
  8620.  
  8621.  
  8622.  
  8623.  
  8624.  
  8625.  
  8626.  
  8627.  
  8628.  
  8629.  
  8630.  
  8631.  
  8632.  
  8633.  
  8634.  
  8635.                                 - 148 -
  8636. ................................................................................
  8637.       V.A.T. FUNCTIONS           FUNCTION            V.A.T. FUNCTIONS
  8638.  
  8639.       Easy Base has a set of five VAT rates which can be altered from
  8640.       the utilities menu. There are four VAT functions:-
  8641.          VATin
  8642.          VATon
  8643.          PlusVAT
  8644.          MinusVAT
  8645.  
  8646.       Ex.   VATin(retailprice,2)
  8647.              < Returns the VAT content of "retailprice" at VAT rate 2
  8648.  
  8649.       Ex.   VATon(netprice,4)
  8650.             < Returns the VAT to be added to "netprice" at VAT rate 4
  8651.  
  8652.       Ex.   PlusVAT(netprice,3)
  8653.             < Returns the VAT inclusive price at VAT rate 3>
  8654.  
  8655.       Ex.   MinusVAT(retailprice,2)
  8656.             < Returns the net price of "retailprice" before VAT at
  8657.               VAT rate 2>
  8658.  
  8659.        (assumes Retailprice as VAT Inclusive and Netprice exclusive)
  8660.  
  8661.       If the second parameter (rate) is omitted from any of the VAT
  8662.       functions then Rate 1 is assumed.
  8663.  
  8664.       Ex.   Gross = PlusVAT(input.net)
  8665.             < The variable "Gross" = the VAT inclusive of the input
  8666.              screen field "net" calculated at rate 1.>
  8667.  
  8668.       Although the VAT functions are primarily included for business
  8669.       applications, they can be used for any purpose where a
  8670.       percentage needs to be changed globally throughout an
  8671.       application without the need to alter each procedure or field
  8672.       derivation in which it is used.
  8673.  
  8674.       Acceptable parameters:
  8675.  
  8676.       1   Any numeric value, field, variable, expression or function
  8677.       2   As Parameter 1 but evaluating between 1 an 5
  8678.  
  8679.  
  8680.  
  8681.  
  8682.  
  8683.  
  8684.  
  8685.  
  8686.  
  8687.  
  8688.  
  8689.  
  8690.  
  8691.  
  8692.                                 - 149 -
  8693. ................................................................................
  8694.       Write                    File Command                     Write
  8695.  
  8696.       The "Write" command writes data to a non Easy Base file which
  8697.       has been opened with the "Open" command.
  8698.  
  8699.       The Syntax is:
  8700.  
  8701.       Write (Text, Variable, Field or Function) [Line_len (length)]
  8702.  
  8703.       The Line_Len keyword and parameter are not required.
  8704.  
  8705.       Ex.
  8706.  
  8707.       Write "Once upon a time"
  8708.       Write LineVar
  8709.       Write Customers.name
  8710.       Write Jointext(customers.forname," ",customers.surname)
  8711.       Write Customers.notes line_len 60
  8712.  
  8713.       Notes:-
  8714.  
  8715.       The contents of a text field is supplied without leading or
  8716.       trailing spaces. The contents of a text variable is supplied
  8717.       without trailing spaces. You can pad the output with either of
  8718.       the functions "Spacepad" or "stringof".
  8719.  
  8720.       The following code writes customers names and account Nos in
  8721.       two columns to an ASCII file.
  8722.  
  8723.       Open "C:\WP\NAMES.TXT"
  8724.       for customers with name in order
  8725.          write stringof(5,chr$(32))
  8726.          write spacepad(customers.name,30)
  8727.          write customers.acno
  8728.          write chr$(13)
  8729.          write chr$(10)
  8730.       next
  8731.  
  8732.       The contents of a text block field is supplied reformatable ie
  8733.       a single CHR$(13) is used to denote where a new line is to be
  8734.       forced. If you write a text block field without the Line_len
  8735.       keyword it will be written in this format.
  8736.  
  8737.       To write a text block field as ASCII Lines use the Line_Len
  8738.       keyword. The Line_Len value does not have to be the same as the
  8739.       width of the text block field. Easy Base will word wrap the
  8740.       contents to whatever Lin_Len value you supply.
  8741.  
  8742.       You cannot write quotation marks within quoted text.
  8743.       To write "Fred said "@*!" to Bill" you must replace the inner
  8744.       quotation marks with ASCII character 127. (Hold down the Alt
  8745.       key and type 127 on the numeric keypad)
  8746.  
  8747.       See also: Open, Close, Read, Seek, Find
  8748.  
  8749.                                 - 150 -
  8750. ................................................................................
  8751.       YEAR                       FUNCTION                        YEAR
  8752.  
  8753.       This function returns the year number from a date parameter.
  8754.  
  8755.       Ex.    Year(system date)
  8756.  
  8757.       Ex.
  8758.  
  8759.       Carage = jointext((year(system date)-year(registered))," Years
  8760.       old")
  8761.  
  8762.  
  8763.       Acceptable parameters:
  8764.  
  8765.       System date
  8766.       Date field
  8767.       Makedate function
  8768.       Date expression
  8769.  
  8770.  
  8771.  
  8772.  
  8773.  
  8774.  
  8775.  
  8776.  
  8777.  
  8778.  
  8779.  
  8780.  
  8781.  
  8782.  
  8783.  
  8784.  
  8785.  
  8786.  
  8787.  
  8788.  
  8789.  
  8790.  
  8791.  
  8792.  
  8793.  
  8794.  
  8795.  
  8796.  
  8797.  
  8798.  
  8799.  
  8800.  
  8801.  
  8802.  
  8803.  
  8804.  
  8805.  
  8806.                                 - 151 -
  8807. ................................................................................
  8808.       ZEROPAD                    FUNCTION                     ZEROPAD
  8809.  
  8810.       The Zeropad function pads an integer or fixed point field to a
  8811.       given number of places left and right of the decimal point.
  8812.  
  8813.       Ex.  Zeropad(price,3,2)
  8814.            <Returns "001.50" if price = 1.5>
  8815.  
  8816.       Ex.  Zeropad(acno,6,0)
  8817.            <Returns "004532" if acno = 4,532>
  8818.  
  8819.       The Zeropad function can be used as in the second example to
  8820.       return a fixed length numeric string from an integer field.
  8821.       It's main use, however, is in the creation of fields for
  8822.       compound indices where one of the fields to be compounded is a
  8823.       number.
  8824.  
  8825.       For example: A school has all pupils names and ages recorded on
  8826.       a form in fields "name" and "age". To create an index which
  8827.       will list pupils names alphabetically but grouped by age a
  8828.       compound field which is invisible and does not allow user entry
  8829.       is created as a text field derived with:-
  8830.       Jointext(zeropad(age,2,0),name)
  8831.  
  8832.       Because the compound field is text the index file will be
  8833.       sorted alphabetically. If you sort the numbers 8,9 and 12
  8834.       alphabetically you get 12,8,9 because the one in 12 comes
  8835.       before 8. If however you sort the numbers 08,09 and 12
  8836.       alphabetically you get the correct numeric order.
  8837.  
  8838.       By using the zeropad function in the above example and indexing
  8839.       the compound field,let's call it "unifield" you could then
  8840.       print out the pupils in age groups with the names in each group
  8841.       arranged alphabetically.
  8842.       .........................format.................
  8843.       .group header
  8844.        Pupils aged {pupils.age field}
  8845.       .list items
  8846.               {pupils.name field}
  8847.       .end
  8848.       .........................procedure code.........
  8849.       declare output fields
  8850.          pupils.name:pupils.age
  8851.       end
  8852.       declare variables
  8853.          agecheck as number
  8854.       end
  8855.       agecheck = 0
  8856.       for pupils with unifield in order
  8857.          if pupils.age <> agecheck then print group header
  8858.          agecheck = pupils.age
  8859.          print list items
  8860.       next
  8861.  
  8862.  
  8863.                                 - 152 -
  8864. ................................................................................
  8865.